Khan Khan - 1 year ago 83
Android Question

Create database after deleting by syntax this.deletedatabase("database_name") where database_name is my database name

I have deleted my database with:


in Android example and now I want to create database of same name or any other name with adding more column or table should it possible and how and it is possible to add another table in database without upgrading database version how? And how to set limit to number of rows in database?

Answer Source

In regard to your last part of the question, this is not as simple as you want it to be. You have to programmatically limit the amount of rows. Like something with the following pseudocode

if number_of_rows in <table> > limit
    do not insert
    remove oldest row and insert new
    insert row

But why would you ever want to limit the amount of rows in a table?


You can infact remove your database programmatically. You have to use a reference to the context to remove it with deleteDatabase

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download