How to view data saved in android database(SQLite)?
You can access this folder using the DDMS for your Emulator. you can't access this location on a real device unless you have a rooted device.
You can view Table structure and Data in Eclipse. Here are the steps
- Install SqliteManagerPlugin for Eclipse. Jump to step 5 if you already have it.
- Download the *.jar file from here
- Put the *.jar file into the folder eclipse/dropins/
- Restart eclipse
- In the top right of eclipse, click the DDMS icon
- Select the proper emulator in the left panel
- In the File Explorer tab on the main panel, go to /data/data/[YOUR.APP.NAMESPACE]/databases
- Underneath the DDMS icon, there should be a new blue icon of a Database light up when you select your database. Click it and you will see a Questoid Sqlite Manager tab open up to view your data.
*Note: If the database doesn't light up, it may be because your database doesn't have a *.db file extension. Be sure your database is called [DATABASE_NAME].db
*Note: if you want to use a DB without .db-Extension:
Download this Questoid SqLiteBrowser: http://www.java2s.com/Code/JarDownload/com.questoid/com.questoid.sqlitebrowser_1.2.0.jar.zip
Unzip and put it into eclipse/dropins (not Plugins)
Check this for more information
View contents of database file in Android Studio
Finally, i found a simplest solution which do not need to open the DDMS.
Actually, the solution is based on what @Distwo mentioned, but it don't have to be that complicated.
First, remember the path of your database file in the device, it should aways the same.
For example mine is:/data/data/com.XXX.module/databases/com.XXX.module.database
Second, execute this command which pulls your database file onto you PC
adb pull /data/data/com.XXX.module/databases/com.XXX.module.database /Users/somePathOnYourPC/
What you need to do is just copy and store this command, then you can use it again and again.
Third, if you got Permission Denied or something like that, just run adb root
before the previous command.
Where is my sqlite database stored in android?
In my rooted phone, it's in : /data/data/<your_app_package_name>/databases/<database_name>
exemple
/data/data/com.my.package/databases/mydb
How to see the data stored in sqlite in android studio using genymotion as emulator
Go to
Tools -> DDMS
or click the Device Monitor icon next to SDK Manager in Tool bar.Device Monitor window will open. In File Explorer tab, click
data -> data -> your project name
. After that your databases file will open. Clickpull a file from device
icon. Save the file using .db extension.Open FireFox, Press Alt ,
Tools -> SQLiteManager
.Follow Database -> connect to Database -> browse your database file and click ok. Your SQLite file will opened now.
SQLite Database storage in /data/data Android
I think you hav to change the DB_NAME variable from "my_database" to "my_database.sqlite"
and u cant see your database on your internal memory... bcoz the database will save only to the system folder...
if u want to check it u might need a rooted android device or you can check using android studio...
check this link... check database if exist in android studio
Android - Where is SQLite Database stored
Open the DDMS perspective Window: (window->open perspective->other->DDMS) It should open in a new tab.
Go to DDMS -> file explorer -> data -> data -> see your package name -> databases -> here your database file. (In the upper right, choose "Pull file" from device.) Export it and open through an Sqlite database connector.
You will see your updated data. Before taking these steps make sure that you have run your application first.
View SQLite database on device in Android Studio
Connect to Sqlite3 via ADB Shell
I haven't found any way to do that in Android Studio, but I access the db with a remote shell instead of pulling the file each time.
Find all info here:
http://developer.android.com/tools/help/adb.html#sqlite
1- Go to your platform-tools folder in a command prompt
2- Enter the command adb devices
to get the list of your devices
C:\Android\adt-bundle-windows-x86_64\sdk\platform-tools>adb devices
List of devices attached
emulator-xxxx device
3- Connect a shell to your device:
C:\Android\adt-bundle-windows-x86_64\sdk\platform-tools>adb -s emulator-xxxx shell
4- Navigate to the folder containing your db file:
cd data/data/<your-package-name>/databases/
5- run sqlite3 to connect to your db:
sqlite3 <your-db-name>.db
6- run sqlite3 commands that you like eg:
Select * from table1 where ...;
Note: Find more commands to run below.
SQLite cheatsheet
There are a few steps to see the tables in an SQLite database:
List the tables in your database:
.tables
List how the table looks:
.schema tablename
Print the entire table:
SELECT * FROM tablename;
List all of the available SQLite prompt commands:
.help
Source : This SO answer..
Related Topics
Android Listview with Header and Footer Buttons
What Is More Efficient? Static, Data Passing, Shared Preferences, Database...
Mediaplayer Stop Playing After About 5 Seconds
How to Work-Around the Blank Title in Pagertitlestrip and Pagertabstrip
Download Images Using Android Webview
Android 4.3 and Phonegap, Cant Tap Link
How to Compile Ffmpeg-2.2.2 on Windows with Cygwin and Android Ndk R9C
Fcm (Firebase Cloud Messaging) How to Send to All Phones
Disable The Swipe Gesture That Opens The Navigation Drawer in Android
Using Android Studio with Vuforia
Open Google Maps Through Intent for Specific Location in Android
Android in Navigation Drawer When I Click Anywhere Drawer Closes
Parsing Date/Time to Localtimezone
How to Use Firebase Functions to Send Fcm to User
Why Does Calling Getwidth() on a View in Onresume() Return 0
Set Rowspan or Colspan of a Child of a Gridlayout Programmatically