Where is my application? / Data look empty

I almost feel awkward asking about it, but I really can't find my application on my phone. I read that the application should be installed in the / data / data / folder, but the my / data folder looks empty when viewed in Astro. My application is definitely installed on the phone, do I have to transfer it to SD so that it becomes visible? I have an Unrooted HTC Desire HD on Orange UK. I just need to look into the SQLite database managed by my application.

+4
source share
3 answers

I'm almost confused asking about this, but I really can't find my application on my phone.

Find it in Settings> Applications to see if it is installed. If so, any actions that you declared in the LAUNCHER category ( MAIN action) will be displayed in the launch pad.

I read that the application should be installed in the / data / data / folder, but the my / data folder seems empty when viewed in Astro.

You do not have permission to view this directory on an unloaded phone.

My application is definitely installed on the phone, do I have to transfer it to SD so that it becomes visible?

Your application will no longer be "visible."

I just need to look into the SQLite database managed by my application.

Add a backup / restore function to the application that copies your SQLite file to / from external storage. Make sure all your SQLiteDatabase objects SQLiteDatabase closed first.

+11
source

The simple answer would be

  • If you need to browse the Data directory in a real phone, this must be the root device.
  • You can simply browse the Data directory in the simulators , because the simulator acts as a root device and has all superuser access.

Happy coding !!!

Update

There is another way: copy the database to the SD card from the function below,

 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) { } } 
+7
source

root is not necessary if your application is being debugged ( android:debuggable="true" ) see How can I see the contents of sqlite db of my application on a real device?

0
source

Source: https://habr.com/ru/post/914449/


All Articles