Android Question File not included in Assets

Paul Leischow

Member
Licensed User
Longtime User
I have a 4MB sqlite database that I have added to my project using Add Files in the Files Manager.
When I run my app in debug mode, all files are copied over to my device and show up in the virtual_assets folder except my database which is only 1.7MB in size, making the database unusable since it is now corrupt.
If I compile my app in Release mode, the APK contains an assets folder which has a compressed version of my database... 4MB down to 1.7MB

It kinda looks like the debug version is compressing the database and then copying it to the virtual_assets folder making it unusable since it is not uncompressed.

Also, if I try to install the APK that was created in release mode, the assets folder is never created on the device for some reason and the assets are not unpacked.

If I do not include the database, everything works fine in both debug and release mode.

Any ideas here?
 

Paul Leischow

Member
Licensed User
Longtime User
OK, I'll answer my own question....
It looks like the database IS compressed or something making it smaller on the device but you cannot use the database while it is in the assets folder (which I discovered after lots of reading).
The database file becomes the proper size once the app copies it from the assets folder to a writable location.
Now everything works as expected in both debug and release mode!
 
Upvote 0
Top