location and copy SQLite file

billy047

Member
Licensed User
Longtime User
Hello to you all, two questions of location of SQLite. 1 .- I created a SQLite db in the emulator, but I need to change the content outside the emulator, and once already done, then return it to continue operating in the emulator, I do not find it on my pc where is the file SQlite . Help do not know how to do it.

2 .- I am upgrading a SQLite database on my PC with lots of information, using a program I did in VBNet, then I need to copy the db to my device, so that my application in B4A, can use it. Where to put the SQLite file to test with the emulator and Device?

Thank you for your help.

Guillermo
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The emulator doesn't have access to Windows file system and you cannot directly access the emulator files from Windows.
You can add the database to your project in the Files tab and then it will be packaged in the APK file.
You will then need to copy the database from DirAssets to a writable location. See DBUtils.CopyDBFromAssets.
 
Upvote 0

billy047

Member
Licensed User
Longtime User
OK Erel, being so, then apply your suggestion and will try in addition to looking for another way for this situation. Thank you very much for your attention and response.

Have a nice day
Guillermo
 
Upvote 0

AscySoft

Active Member
Licensed User
Longtime User
Or, you could use adb commands to copy files from/to device or emulator
If your file is located on emulator/device sdcard and named file1.sqlite, this is the command

adb pull /sdcard/file1.sqlite c:\myData -copy from device to desktop

and after all the modifications...(I'm using Sqlite Manager for firefox)

adb push c:\myData\file1.sqlite /sdcard/file1.sqlite

IMPORTANT: android system is case sensitive(so I figured), so for sure keep always your caps down!

If you don't know what adb is, see this Android Debug Bridge | Android Developers
 
Upvote 0

naruto

Member
Licensed User
Longtime User
In my case the example database called test1.db could be found at
/data/data/com.stackz4android/files
inside the emulator.
 
Upvote 0
Top