I want to store some data like name and class of different students in form of SQLite database.
I want to develop an application which uses this data not fill it. I mean application should not fill it.
My application will use this data to make a report. This database should be bundled with my android app
So how to create this database on android?
How to bundle this database with the app on android?
I mean my file should be an apk but when installed it should have this database also
Please kindly give your advice
Yours Sincerely,
ChinniKrishna Kothapalli.
Basically, you need to do that :
1) Create a file containing your SQLite database into your assets folder
2) When you want to access your database, check if /data/data/yourpackage/databases/yourdatabase.db exists
3) If it doesn’t exist, copy it from your assets to /data/data/yourpackage/databases/yourdatabase.db
4) Call SQLiteDatabase.openDatabase (it takes a path in parameters)