So i have been looking for this answer for the past 2 days. all of them want to know how to extract the database file .sql from the device your testing your app on. What i want to do is use a manager, like fire fox's sqlite manager, to open the location of the file and view the data base as information is being entered. I did this once when i was using titanium, but now have switched to eclipse. So what i want is, when i am running my virtual machine, android emulator, i want to fine the location that it is reading the sql file from. doing this i can open it with my fire fox manager and as info is going into the file the manager will show me whats going in and out. Basically i want to see real time info from my internal database, either from emulator or phone. PLEASE HELP!
Go to this link and get the SQLiteManager plugin for eclipse.
Related
Hello I am learning android an i have created a database with one table using SQLite.The problem is i want to view my database file to see if i am doing right or not.
I have searched on similar but solution i got was using emulator but i am using my device to run the app and i have no idea how i can get database file. Please any one who has got any solution.
NOTE: i am using ANDROID STUDIO and device to run App, want to view my database on my laptop or pull the file on laptop/system memory.
Thanks.
I implemented my first app using Xamarin Studio (Mono for Android). This app stores some data in a SQLite db, which works fine on a Sony Tablet S device.
My question is: is there a way to get db file and see, for example, its size?
I looked up to the following path
/data/data/My-Application-Package-Name/databases/My-database-name
but it doesn't seem to exist.
Thanks for any help!
You can use Eclipse to go right to it using the sqlite manager plug-in (http://www.coderzheaven.com/2011/04/18/sqlitemanager-plugin-for-eclipse/)
Download the *.jar file from the website I reference above to the
"dropins" folder in eclipse (open your eclipse folder and you should
see it)
Then restart eclipse and go to the DDMS. You may have to do
windows->views-ddms if it isn't already being displayed...
Select your device from the left panel then use the file explorer to go to your data
directory/YOURAPP/databases. Hopefully there will be an icon that
shows up when you select your database. If not, rename your database to use the "db" ext.
Click it and it should open in the manager tab.
This is a valid database location (//data/data/My-Application-Package-Name/databases/My-database-name), but you can access it from file managers if you have root access only.
Look how it can be done here. Otherwise, if you want to get some info trough the code, you're doing something wrong, so publish the code and logcat.
I am working on a test of an Android application that runs the SQLite methods in the Android API. I would like to get code coverage of the SQLite code in the Android Open Source Project (AOSP), and I have it set up to run G-Cov and save that coverage information when I run my test. However, I have no idea where this coverage information is stored. I assumed it would be in data/data/package-name, but I don't see anything, and I couldn't successfully pull all of my files off of the Android emulator.
Does anyone know where this file will be stored? I'm not sure if it is stored with SQLite or on the emulator (which is where I assume, as I did not see it in the SQLite directory).
Thanks.
EDIT: Specifically, I am looking for *.gcno and *.gcda files.
EDIT: Now I'm thinking they have to be on a shared library on the emulator, although in File Explorer (I am using Eclipse Juno with ADT), I see nothing close to /lib/* and /data/data/package-name/lib is empty. Anyone know where that location could be?
is in data/data/ nothing?
when this folder is empty, maybe try sqlite manager for eclipse
I am working with SQLite in an App. It writes to the database, etc., with no problem. However, I can not find this new database. I have tried changing the directory with cd /data/data/packageName/databases, but it says "no such file or directory". Also, this database is not found when I click on the File Explorer in eclipse. My logging tells me the database was created and that it is being written to. I think I need to set the path in the shell or something to that effect using adb, but I have no idea how to do that. Can anyone give me some instruction? Also, I am using my phone for development. The database also does not show up when using the emulator.
Thanks very much.
Matt
Matt,
This thread gives a good explanation on why you might not be able to access the data folder on your phone.
Can't access data folder in the File Explorer of DDMS using a Nexus One!
You can still test the Sqlite code though. Just boot up an emulator. The emulator will have no access restrictions. Once it's booted up you can use the ddms tool (located in the tools directory under your android SDK install folder). It has a File Explorer and you can download the files from the /data folder.
Also, I am using my phone for development.
You cannot access the database on a standard Android device except via your own application code.
Your options are:
Do this sort of testing on an emulator, in which case you can access the directory that you are failing to access on the device
Add a database backup feature to your app, that copies the (closed) database to external storage, so you can examine it
Root your phone (leastways, I am under the impression this can help get you to this directory -- haven't done it myself)
The database also does not show up when using the emulator.
Try harder. If you can store data in the database and read data out of it using SQLiteDatabase, then the database file is there.
Apps runs fine on emulator, but the same does not on device(Samsung S5670). Its showing that the database is empty.
Should i need to upload databases separately or it is embedded in apk itself.
I have also check the File explorer in DDMS -> "Data" section could not find any data in it.
Do i need to make any other setting on device
I guess you didn't write the required SQLite helper class that initializes your database. Somehow once you managed to create the correct database on the emulator, so it works on that. Try uninstalling your app completely from you emulator, reinstall it, and see if it works. Only updating you app doesn't remove data associated with it on the device, so i doesn't affect your database, hence you need to uninstall.
If it stops working on you emu too, then you need to go look into your SQLite helper class.