Access Private Data on Android
According to the official developer documentation, here are the options for data storage on Android:
- Shared Preferences — Store private primitive data in key-value pairs.
- Internal Storage — Store private data on the device memory.
- External Storage — Store public data on the shared external storage.
- SQLite Databases — Store structured data in a private database.
- Network Connection — Store data on the web with your own network server.
Aside from the network connection option, the other options are all persisting data on device. Both SharedPreferences and SQlite Databases are private data stored on device. These files are not accessible to other applications or users unless you are on an emulator or rooted device. Here are a few ways how I access and inspect these private data for debugging during development.
Access private files
On an emulator or rooted device
If you are running an emulator or rooted device. You should have access to the private storage of the device. You can access the files from Android Studio GUI or via command line:
- GUI — In Android Studio, launch Android Device Monitor from the menu: Tools/Android/Android…