One of the most common and probably the most essential operations in a data-driven application is fetching data from the database. So, at times when developing an application, we need to see the database. While Android has SQLite Database and the Android Studio has no direct option to view the database. So, today we will be learning how to access Databases on an Android. The article will guide you step by step, providing you visual representation to help you efficiently fetch data from the database. This is especially useful in case you have a web server, and you wish to access data on an android application.
How to Access database on Android
If the mobile phone is rooted, all applications install in that mobile device are vulnerable. This can compromise application data. There are multiple ways to fetch the database of a mobile device and even the applications installed in there, one of them we will be using, Terminal.
To access the database of the application, it is required to check if the application has enabled ANDROID: BACKUP= True. If it is enabled, it is easy to retrieve the database of a particular application.
For this you require:
1) Rooted Device
2) Terminal Installed
Steps:
- Create a Backup folder in the Mobile device.
- open terminal and gain super user permission using “su” command
- go to data/data folder
- find . –name “*.db” –type f –exec cp {} /mnt/sdcard/Backup \;
- Open windows2 of the terminal. gain SU access
- locate the directory, and you got the database available the mobile device
Watch the video here: