For my android application, I would like to use a large database (about 45 MB).
One solution would be to include the (splitted) database in the assets folder and cop
One solution would be to include the (splitted) database in the assets folder and copy it to the database directory on the first startup.
It would not have to be split, just ZIPped. See SQLiteAssetHelper for an example.
How could I do this?
Use HttpUrlConnection
. Or, use HttpClient
.
Can I download a complete SQLite file and save it to the database directory?
Yes. Use getDatabasePath() to get the correct local path to use.
Or should I rather go with JSON data files that are used to populate the database?
You could, but for 45MB, that would be ghastly slow.