Using sqlite db created in Windows but to be accessed in Android
I already have a sq开发者_StackOverflow中文版lite3 db file that I created in Windows, is there a way to package this file into my android application and access it as a sqlite db from within the application or do I have to create a db on application load or something in Android only?
The db has about a thousand records, so writing sql scripts again might be monotonous and cumbersome.
Got this link, seems to serve my purpose
Package it as an asset or raw resource. Copy it out from there onto the appropriate spot on the device. Downside: You will take up 1.5x to 2x the space on the flash (for the possibly-compressed copy stored in the APK plus the actual to-be-used copy).
Or, download the database from a server on first run.
精彩评论