DDMS File Explorer Internal SD Card Path

900 views
Skip to first unread message

Adam MacDonald

unread,
Nov 21, 2012, 11:51:55 AM11/21/12
to adt...@googlegroups.com
I write apps which heavily utilize SQLite databases, which are stored on the internal SD card at a specific path.  

When I need to verify the contents of the DB based on what the app is doing, I usually take the DB off of the device and read it on my computer.  I found that the new devices that I have been using (Acer a501, Huawei Mediapad 7, and Nexus 7) when connected to the computer show up as a Media Device, and not the External Storage device that I had gotten with the original Samsung Tab 7.  That leads the database to become malformed when transferring over the Media Device channel.  

I was able to work around this by using the DDMS File Explorer and save the file that way, but I can't seem to locate the Nexus 7's internal SD card path via the File Explorer. 

Is there a better way to transfer a SQLite database without malforming it, and if not, how would I locate the internal SD card path via DDMS's File Explorer window?

Thanks,
Adam

Adam MacDonald

unread,
Nov 21, 2012, 11:57:25 AM11/21/12
to adt...@googlegroups.com
I was able to locate the path once I started digging.  Admittedly it was in a place I would not assume to look to begin with: mnt/shell/emulated/0/

Adam

Siva Velusamy

unread,
Nov 21, 2012, 11:58:23 AM11/21/12
to adt...@googlegroups.com
In the file explorer, look at what /sdcard points to, and keep
following the symlink chain until you reach the correct folder. I
don't have a device to check right now, but it should be something
like /storage/emulated/0.

You can pull the file directly from the command line using: $ adb pull
/sdcard/path/to/file

Jonathan Steele

unread,
Nov 21, 2012, 2:20:17 PM11/21/12
to adt...@googlegroups.com
It is unwise for hard-coded sdcard path. It is best to use API in android.os.Environment
Reply all
Reply to author
Forward
0 new messages