Reputation: 11
I have created a sqlite database and table in android studio, but the sqlite database folder is missing in the device's file explorer.
I have written the following code in the databasehelper.java
class
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table "+TABLE_NAME+"(sr INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, datetime TEXT, location TEXT, odometer INTEGER, speed INTEGER, GPS TEXT, int.volt INTEGER, ext.volt INTEGER )");
}
Upvotes: 0
Views: 4200
Reputation: 1
1 create table 2 upgrade table 3 insert value in table 4 (make sure that) add table field in List and call the method in MainActivity eg. - db.gelAlldata(); 5 then run and synchronize ur project package
Upvotes: 0
Reputation: 1688
There might be a possibility that you have not connected the android device in USB file transfer mode. I had this issue in Android 9 and fixed it by connecting the device in USB file transfer mode.
Upvotes: 2
Reputation: 615
Firstly you need to check that your database is successfully created or not, if your database is created then you can follow these steps:
Upvotes: 0
Reputation: 11
solved this issue. now my database folder is visible in device file explorer. i delete my old database. also remove databaseHelper class. and create a fresh database and table. may be i missed some steps while creating database thats why database folder is missing. now its working.. thank you for ur help
Upvotes: 0
Reputation: 131
The default location of database is
/data/data/<your_app_packagename>/databases/db_name.
It is not accessible in non-rooted devices. You can create your database in different location for debugging.
Upvotes: 0