Export Database to Host PC

You must Login before you can answer or comment on any questions.

Greetings,

I am developing for Android.

In the application I am developing, I am using a database and would like to save it to the local drive on my PC to view the data it contains (outside Titanium) as well as to make a backup.

I notice it is possible to 'install' a SQLite database from my PC but can't figure out how to do the opposite.

Is this possible? Could someone please show me how?

Cheers, DJ

— asked 8 months ago by D J
0 Comments

3 Answers

Accepted Answer

Unlike the iOS simulator which stores its file system on its host, easily accessible, the android developer environment is a virtual machine, locking up its filesystem in the VM.

You can use the DDMS utility, provided with the Android SDK in the tools subfolder. You can use it to browser the device/emulator and upload/download files from within.

You can also use adb from the command line to copy files to and from the device/emulator

— answered 8 months ago by Stephen Feather
answer permalink
1 Comment
  • Thnx Stephen, DDMS is the answer! In DDMS, after selecting my device name (in the Top Left window), I used the menu option Device=>File Explorer to view the file system.

    I found my database in the /data/data/"myapp"/databases folder

    Cheers, DJ

    — commented 8 months ago by D J

I don't have a Document folder in my Titanium project structure.

The database is inside the emulator, and I would like to export/save it to my PC but don't know how. I've looked at the Filesystem class in the Titanium API. I think I can access the file in the "file:///data/data/" folder but don't know how to transfer it to the PC.

Rainer, thnx for the heads up regarding Sourceforge.

You found the SQLlite-DB in Document folder of your app. You can open it with i.e. "SQLite Database Browser" (Sourceforge).

Hope this helps

Rainer

Your Answer

Think you can help? Login to answer this question!