copying database

canalrun

Well-Known Member
Licensed User
Longtime User
You can use 'adb' or 'ddms' tools which are part of the Android sdk to copy files to the emulator.

If the database is not too large you can also add it to the Files manager and then copy it from the assets folder to the storage card.

Hi,
I copied the preceding quote from another thread.

I need to provide a database with my app. I have added the database in the files tab of B4A. During execution I copy it from the assets directory to the defaultexternal directory using code I found on this forum. When I try to do that copy I get an I/O exception.

I see in the above reply you say "if it's not too big". How big is not too big? My database file is 2.9 MB. Too big?

If bigness is not the problem any ideas what could be? Using DDMS I can see that my app creates and tries to copy the target database file to the right place, but creates an I/O exception and ends up with a size of zero.

I will try a smaller DB file tomorrow. But, I wonder how to supply a database of fixed information to be distributed with the app?

Thanks,
Barry.
 
Top