Android, SD-card and resource path
I have a read only SQLite
database that's about 40mb uncompressed, and I'd like to add this to a resource path on the SD card. (In the same way I might have /res/drawable
or /assets
etc.)
Can I do this as part of the project's file structure on all versions of Android (2.2 or later say) and on all devices?
(I don't want to do this within code, that's not an option. And I've set the manifest to declare 开发者_高级运维prefersExternal.)
Installing a program with such a large asset size will be an issue on a large number of mobiles with small internal storage and no SD card, however, tablets do tend to have large internal storage. I believe moving the file from the RAW folder will be your only way (/res/raw)
Have a look at this approach to spilting a database file into multiple sub files and then merging them on 1st run, but this does require code to access and create the usable database file.
Also consider compressing the file beforehand as well and then remember to decompress later as well. High compression rates can be obtained with database files. This will have the extra bonus of meaning your application's installer won't be quite as big.
精彩评论