Thoughts on managing DB template for multiple DBs within app?

Guitarist

New Member
Joined
Dec 27, 2019
Messages
5
Reaction score
0
I could use some thoughts or insights on the best approach to handing multiple SQLite DBs for an Android app. I have an existing Java application that acts as a Research tool and I want to convert it to an Android app. I'm new to Android development and could use some ideas on the best approach.

About the App:
The existing Research DB is an app that allows a user to create a subject oriented database for research that requires the user to document a source for each note on the subject... literally as if doing research or as you would for a thesis or research paper. Sources can be books, videos, articles, online resources, etc. and files can be attached. So there is a blank template database (i.e. blank.db) that is copied and renamed to the subject the user chooses to research. The SQLite template database contains 11 tables linked to a Notes table. The remaining 10 tables are Sources, Authors, Author_by_Source, Comments, Quotes, Terms, Topics, Files, File_by_Note, Questions.

However, a user can delete or destroy any database they wish except the blank.db and sample.db which come with the app.

I attached a Zip file example of the blank.db (SQLite)

What have I done:
I've have been reading and doing hands-on tutorials learning the Android C.R.U.D approach through the DatabaseHelper, which is so cool and so simple. I've also learned about the Asset folder and storing databases already created within a sub folder called databases. I already see room for improvement to my existing app. So this where I ask my question(s).

So the Discussion Questions:
What is the best way to handle creating new databases?
Currently, a blank.db template is copied and renamed. The user simply selects from a menu "Create New Database" and provides a name for it. Then the blank.db is copied and renamed. However, I'm thinking it should just be programmatically created every time... thoughts?

Would there be a good book or online resource (or pattern) on how to handle this type of database creation/template and management?

Do I manage everything through the Assets folder?
Lastly, in my Java app, I had to create all the necessary directories and push the necessary files and DBs upon first install. The app then links to and manages all those sources for recalling and managing user setup, DBs etc.
 

JandN2639

Active Member
Joined
Jan 19, 2017
Messages
274
Reaction score
82
Please move this to a forum for app development.


Sent from my iPhone using Tapatalk
 

Sajo

Diamond Member
Joined
Jan 25, 2013
Messages
20,705
Reaction score
16,835
Location
Tennessee
Current Phone Model
Pixel 7 Pro
@Sajo, can you help?


Sent from my iPhone using Tapatalk
Help with what? I see that the post was already moved to the App Development thread.

And FYI...I am not a moderator or admin, so I can't help with moving posts from one thread to another.

Sent from my moto z4 using Tapatalk
 
Last edited:
Top