Reputation: 99
Pretty simple question, can I send a already created database (a file, for instance) with my application? Or do I have to create it inside my application?
Upvotes: 0
Views: 149
Reputation: 5825
Some apps include an SQLite database in the assets folder, and copy it when the app is launched.
Upvotes: 0
Reputation: 23556
you may put it into the assets/
folder and copy into the SQLite on the first run.
Upvotes: 0
Reputation: 75645
Yes you can do both. Either create on 1st launch or copy preconfigured database from assets.
For the latter option (which is basically significantly faster if you need your database to be pre-populated) you can use Android SQLiteAssetHelper to do all the job.
Upvotes: 3