• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Create SQLite db with data

larryse

Lurker
I am creating a Q & A app. i was thinking of storing the info in the SQLite db. I figured i would create the app with some text file to store the info and when the db was created it would read the text files and save the data in the db, then delete the text files.

1. is this possible, to delete the files
2. is this the best way to do it.

thanks
 
My thoughts:

1) If you have some TXT file inside your assets,
you can just leave it after copying into DB.
I guess its rather some kB's, so it does not take almost any space.


2) You are planning to write logic that does following:
- convert from text file to java
- convert from java to DataBase
- later, read from DataBase and display this text.

I see redundant work here.
You could skip database,
and just in the moment where you display it, read it from text file.

3) Also another option,
you can create / edit database file on Windows with SQLite Expert,
put some data in there,
and attach this database to your APK,
as a starter DB.
 
Back
Top Bottom