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