I almost feel embarrased asking this but I really can't find my app on my phone. I read that the app should be installed in /data/data/ folder but my /data folder appears to be empty when viewed in Astro. My app is most definitely installed on the phone, should I transfer it to the SD for it to become visible? I have an unrooted HTC Desire HD on Orange UK. I just need to have a peek at the SQLite database managed by my App.
-
My phone is not rooted. Do I really neeed to root my phone just to see the files created by my app? Thanks – TomaszRykala Jan 29 '11 at 19:02
3 Answers
I almost feel embarrased asking this but I really can't find my app on my phone.
Look for it in Settings > Applications to see if it is installed. If it is, any activities you declared in the LAUNCHER
category (action MAIN
) will appear in the home screen launcher.
I read that the app should be installed in /data/data/ folder but my /data folder appears to be empty when viewed in Astro.
You do not have permissions to view that directory on an un-rooted phone.
My app is most definitely installed on the phone, should I transfer it to the SD for it to become visible?
Your app will not be any more "visible".
I just need to have a peek at the SQLite database managed by my App.
Add a backup/restore feature to your app that copies your SQLite file to/from external storage. Be sure all your SQLiteDatabase
objects are closed first, though.

- 986,068
- 189
- 2,389
- 2,491
-
Thanks for the answer, I should have been clearer - the app on my phone is visible and operational but I need to monitor the SQLite db managed by it because I am in the process of writing the methods for my app which manage the DB. I thought I'd have direct access, doh! – TomaszRykala Jan 29 '11 at 19:07
-
1@TomaszRykala: You have direct access to the file on the emulator, but not on standard production hardware. Sorry! – CommonsWare Jan 29 '11 at 19:08
-
Not your fault ;) I don't have a rooted phone because I never felt like I needed it, now it looks like I have to, rubbish :( thanks. – TomaszRykala Jan 29 '11 at 19:11
-
1@TomaszRykala: You do not need to root your phone. See the last paragraph of my answer. – CommonsWare Jan 29 '11 at 19:40
-
Ahh, thanks! I have helped myself with this: http://stackoverflow.com/questions/2170031/backup-and-restore-sqllite-database-to-sdcard – TomaszRykala Jan 29 '11 at 23:24
Simple answer would be,
- If you need to browse the "Data" directory in actual phone, it should be a rooted device.
- You can simply browse "Data" directory in simulators, because, Simulator act as a rooted device and it has all the super user access.
Happy coding!!!
Update
There is another way by copying database to your SD card from below function,
public void exportDatabse(String databaseName) {
try {
File sd = Environment.getExternalStorageDirectory();
File data = Environment.getDataDirectory();
if (sd.canWrite()) {
String currentDBPath = "//data//"+getPackageName()+"//databases//"+databaseName+"";
String backupDBPath = "backupname.db";
File currentDB = new File(data, currentDBPath);
File backupDB = new File(sd, backupDBPath);
if (currentDB.exists()) {
FileChannel src = new FileInputStream(currentDB).getChannel();
FileChannel dst = new FileOutputStream(backupDB).getChannel();
dst.transferFrom(src, 0, src.size());
src.close();
dst.close();
}
}
} catch (Exception e) {
}
}

- 2,488
- 2
- 23
- 30
root is not necessary if your application is debuggable (android:debuggable="true"
) see How can I see the contents of a sqlite db of my app in a real device?