Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see the data stored in sqlite in android studio using genymotion as emulator

As i am having AMD processor in my laptop i am using GENYMOTION as an emulator. I have stored the data in sqlite as it is a plugin in android studio. But if i want to see the data using DDMS the file explorer showing nothing. How can i see the data stored in sqlite database using androidstudio and using GENYMOTION. Thanks in advance

like image 647
VSK Bhargav Avatar asked Feb 19 '15 15:02

VSK Bhargav


People also ask

Where the data is stored in SQLite android?

The Android SDK provides dedicated APIs that allow developers to use SQLite databases in their applications. The SQLite files are generally stored on the internal storage under /data/data/<packageName>/databases.

How retrieve data from SQLite database android and display it in a table?

We can retrieve anything from database using an object of the Cursor class. We will call a method of this class called rawQuery and it will return a resultset with the cursor pointing to the table. We can move the cursor forward and retrieve the data. This method return the total number of columns of the table.

How is data stored in the SQLite database in Android Studio?

Methods of SQLiteDatabase class inserts a record on the database. The table specifies the table name, nullColumnHack doesn't allow completely null values. If second argument is null, android will store null values if values are empty. The third argument specifies the values to be stored.


3 Answers

  1. Go to Tools -> DDMS or click the Device Monitor icon next to SDK Manager in Tool bar.

  2. Device Monitor window will open. In File Explorer tab, click data -> data -> your project name. After that your databases file will open. Click pull a file from device icon. Save the file using .db extension.

  3. Open FireFox, Press Alt , Tools -> SQLiteManager.

  4. Follow Database -> connect to Database -> browse your database file and click ok. Your SQLite file will opened now.

like image 95
sudharsan Avatar answered Oct 17 '22 01:10

sudharsan


One of the things that hasn't changed on Android Studio is the Android Device Monitor. so this applies to AS and Eclipse.

1) Download the jar SQLite browser plugin from https://github.com/TKlerx/android-sqlite-browser-for-eclipse/releases

2) Put the jar in: [YourAndroidSdkDirectory]/tools/lib/monitor-x86_64/plugins/AndroidSQLiteBrowser_1.0.1.jar

3) Restart the Android Device Monitor.

4) Select the .db file inside the device(rooted) or the emulator and click on the SQLite browser on the top right corner next to the (+) new folder button.

5) Enjoy!

like image 38
Abdellah Benhammou Avatar answered Oct 17 '22 02:10

Abdellah Benhammou


pull database using adb commands

adb pull /data/data/com.android.packagename/databases/datebase.db

the db will be pulled to current location where terminal is pointing to

then open db using sqliteman

like image 7
Tushar Saha Avatar answered Oct 17 '22 03:10

Tushar Saha