Debugging Android databases on the real phone - android

I'm trying to debug an android application's database on a real phone. Where can i find any individual application's databases on a real android phone?
Similar to /data/databases on the emulator i tried searching under the /data on my atrix, and i don't find anything under it and i would like to debug databases on the real device.
A second question is does the contact app stores the data at google servers (right / wrong). I beleive this would be the case, but was wondering if they also cache the contact databases in every individual phone to speed up access. please correct me if i'm wrong.

I believe the databases folder is still there on your real phone, but you don't have access to it due to permissions. Database files can only be accessed by the app that owns them so you can't browse all of them unless you have root access.
The contact app stores data on your phone's internal memory so that you can access it without an internet connection. Some android devices (e.g. tabs) do not have internet access, and it's possible to query your contacts list using these devices.

Related

Accessing Android Files and Database Directly on the device if rooted?

When developing for Android I prefer just working with a real device plugged in most of the time since the Android emulators are such total garbage. The one pain point is when I want to access files and sqlite databases though. I believe with the adb shell it is possible to pull the database across, but this isn't a very convenient process.
I'm wondering if there are any tools on the market that allow you to see the database in real time, even if it requires rooting a device I'm open to it.
I am afraid that there are no tools that will let you see the db real time. You will need to get the db from the device and the see it on your system. You will have to root the phone and get SuperUser permission to access app databases. The database will (after getting root) then be available in the /data/data/com.your.application/databases folder.
Hi You don't have any tools to see the database in real times. But its achievable in rooted device. If your device is rooted just install root explorer app in it. and then browse for your package name in data/data/ location. There you will find out all the internal memory files including database files. hope this helps you.

Android Forensic Application

I'm working on an Android Forensic application to retrieve deleted text messages, email and call history from any Android device. I managed to extract several deleted records from sqlite database using my C++ app however to get the sqlite dbs I should be connected to a rooted Android device which is practically not possible as the people who will be using this app doesn't have much technical expertise and they won't be able to root the device.
To work around this problem, I'm thinking about carving sqlites from file system images and I'm very confident of doing the same once I get access to the image files. So I tried dd and nanddump but it seems like they both need write access to the partitions to dump the images.
So I'd like to know whether there is a way to dump the userdata partition without su / root permission on the device?

Sqlite DB with Android some basic questions

I want to use an SQLite database in Android. I have few questions:
Is there a maximum size of database?
How secure is the data?
Where is the database stored?
How long will the data will remain on the phone?
Theoretically, it is calculated as 35 trillion bytes which should be way more than enough for your application because there's always limit to phone's memory. In short, you shouldn't be asking this question for a mobile app :)
If your phone is not rooted then the database stored in phone's internal memory is residing in the most secure storage area. Rooted phone does not offer any security to any file with in internal or external storage medium
If you don't provide any path, then the default/ideal location is phone's internal memory. And the file is placed inside data/data/package_name/database_file. This can be observed on emulator by exploring DDMS -> FileExplorer. If you save the file on other storage mediums, like sd-card, then of course it means you know where you are saving it :)
As long as your phone is functional and you don't wipe the app's cache, uninstall the app or do factory reset. No guarantees if you burn, crush, or spill water on your phone :)
Ok.. I will try and answer most of your questions..
1) Is the Data secure - Android stores app specific data in its app specific location and access is provided to only that application. So, we can say, its pretty secure, because no other app can read your app's data, unless access is provided to 2 applications having a same package name.
2) Location where db is stored - its under data\data\databases\packagename*.db
3) The data will remain on phone, unless the app is uninstalled / android crashes, in which case you would have to clear the phone cache and app cache, thus removing everything from android's inertnal phone memory.

Where does Android keep SqliteDB of an application runs on a tablet?

I could not find the sqlite db file of the application that I am developing runs on a tablet (not on emulator). Please anyone share with me that where does android keep db file of an application. And how do I export it to the computer? And finally is there any tool that can parse an sqlite expression even if it has no db or table? I mean it will only check the phrase and will say the phrase is available to run or not.
Unfortunately, application's database files are not available on non-rooted devices. You can either use a rooted Android device, or Android standard emulator, or Genymotion (see https://www.genymotion.com) in order to be able to access database files of your app.
It keeps it in a private embedded linux folder that's based on your application name, but that only the userid of your application can access.
There is no way for you to copy that file directly unless you root your tablet. In the emulator, that file is directly accessible, but the emulator is a special case.
That being said, there is a programmatic way to pull out the data from that database and reconstruct it on the SDcard to pull it back on your PC (that solution is not perfect, but at least it's better than nothing).
Nope, You can't access the DB of the device (eithr phone or Tablet) via ADB or any other third party Eclipse plug-in.
This was restricted because of security, but you can access it if you root your Tablet or Phone, which is again most people don't prefer to do.
or you can choose to make the db in sdcard (which recomended when the db is too huge).

Where can i store data(text and image) in android

i'm writing an application that needs to store some data,and picture. For example place's information. this information don't need to change very often. and
I have seen that databases are
stored under /data/data/package_name/databases
I decided to store my data under /data/data/package_name/files.
With the emulator i can see all these files (databases)
under the proposed directories but moving the application on a real
device and installing a file system browser i cannot see any file
under /data. i know that there are some security constrain in (not-rooted) device. However, are there any suggestion about the solution.. where can i store these data and how? because i'm quite new to android. Thanks so much for your help.
The reason you can't see it on the device is basically just as you said; the device isn't rooted, so other apps don't have access to the /data folder.
This is okay though, because you can still store your files there. Your app has access to anything under /data/data/package_name/, you just won't be able to see it in a file browser unless you root. This is normally a good thing, to keep average users from mucking around with your databases/files.
Read up more on storage methods here.

Categories

Resources