Create a new database from an existing one (or just create new table ?)

BemeAllebra

New Member
My application is communicating with a database (reading only, stored in the assets file) in such a way that the user can display list of content from this database. For example, a few thousands elements can be displayed from this database in a listview, user can click on any element and get more information. I would like to add a new function which would allow the user to create a "favorite" list. So, every time the user would click on an element from the database, he could click a button "add to favorites", and then from the main menu there would be a button "Favorites" opening a listview with only the elements the user decided to add in the first place. I already have a DatabaseHelper class extending SQLiteOpenHelper, and a DatabaseAdapter class specifying the interactions with my first table. From what I have understood, I can keep one database (and re-use my DatabaseHelper class then) and create a new DatabaseAdapter2 class defining the method for the new table (add new element, delete element, etc.) as well as the fields of my table. Is it right ? I'm not so sure because my DatabaseHelper is defined in "read only" to protect my main table from any modification, but the second table should have to be in "write+read" so maybe it would be better to have a second databaseHelper? It might be a trivial question but i can't find much information about creating a new table/database from an existing one.
 
Back
Top