-1

Can I use the Android Device Manager to see the database or does the database exists only in memory? Below is my code to create the database.

SQLiteDatabase sqlitedb;
sqlitedb = openOrCreateDatabase("MyDB",MODE_PRIVATE,null);
sqlitedb.execSQL("CREATE TABLE IF NOT EXITS MyTable("ID" INTEGER PRIMARY 
        KEY AUTOINCREMENT, NAME VARCHAR(150));
Michael Dodd
  • 10,102
  • 12
  • 51
  • 64
Bernie
  • 1
  • 3
    Possible duplicate of [View contents of database file in Android Studio](https://stackoverflow.com/questions/17529766/view-contents-of-database-file-in-android-studio) – Moshe Edri Oct 10 '17 at 16:07
  • I have looked at that very link. It does not work when I try to see the database. I click on my program link and then click on the data link. Nothing is in the directory. Has anyone tried this lately? Is there some sort of pre-configuration I need to perform to make this work? – Bernie Oct 10 '17 at 16:14
  • then try this one https://stackoverflow.com/questions/6928849/debugging-sqlite-database-on-the-device – Moshe Edri Oct 10 '17 at 16:16
  • This line: `sqlitedb.execSQL("CREATE TABLE IF NOT EXITS MyTable("ID" INTEGER PRIMARY KEY AUTOINCREMENT, NAME VARCHAR(150));` won't even compile – Phantômaxx Oct 10 '17 at 16:38
  • You may find the following of interest/use [Are there any methods that assist with resolving common SQLite issues?](https://stackoverflow.com/questions/46642269/are-there-any-methods-that-assist-with-resolving-common-sqlite-issues/46642271#46642271) – MikeT Oct 10 '17 at 20:49
  • Sorry!!! The line should read sqlitedb.execSQL("CREATE TABLE IF NOT EXITS MyTable(ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME VARCHAR(150));"); – Bernie Oct 11 '17 at 00:20

1 Answers1

0

to answer your question the answer is yes you can.

from the android documents....

From a remote shell to your device or from your host machine, you can use the sqlite3 command-line program to manage SQLite databases created by Android applications. The sqlite3 tool includes many useful commands, such as .dump to print out the contents of a table and .schema to print the SQL CREATE statement for an existing table. The tool also gives you the ability to execute SQLite commands on the fly.

read more in here : https://developer.android.com/studio/command-line/sqlite3.html

Moshe Edri
  • 244
  • 2
  • 10