Reputation: 1248
I have been looking for hours now how to see my database using the program DB Browser for SQLite
(http://sqlitebrowser.org/).
I downloaded the software and i can't find any file on my computer that can be opened with this software.
So what kind of file android SQLiteOpenHelper
class generates? And how can i open it using the software mentioned(Or any other way i can see my database?).
I'm not using emulator. I run my app on an actual device.
EDIT
So i guess i need to do this adb pull data/data/package-name/databases/database-name
and i really dont know how to do it.
Upvotes: 2
Views: 7666
Reputation: 333
In my development i encountered same issue. Your database gets saved in "/data/data/yourapp/database.db".
This is not reachable by default. You have to root your device to view this location. This is something i didn't do. Instead i saved my database in another location that is reachable by default.
public static final String database_path = Environment.getExternalStorageDirectory() + "folder name";
Then i went in the Android Device Monitor and looked at that location to find my database.
Once i found it i used SQLiteStudio to view my database and look if everything is in order.
See http://sqlitestudio.pl for more information
Does that help you out ?
You can put your database where you like, any folder you haver permission on. Then you will have to add the path to your constructor of your helper.
public MyDatabaseHelper(Context context) {
super(context, DATABASE_PATH + DATABASE_NAME, null, 8);
this.myContext= context;
}
How do you get your database? You copy it or you create it programmatically?
Upvotes: 1