I tried to use SQLite on Android. I want to see my database file. So, I use Android File Explorer and browse this link:
Data\data\App_name But in Data\data. I cannot see my app name. (in below code will be: com/app/TimeTracker)
Here my code to test:
first is my main program:
package com.app;
public class TimeTrackerActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TimeTrackerDatabase database = new TimeTrackerDatabase(this);
}
}
and second is my database helper:
package com.app;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class TimeTrackerDatabase extends SQLiteOpenHelper {
public TimeTrackerDatabase(Context context){
super(context, "timetracker.db", null, 1);
}
@Override
public void onCreate(SQLiteDatabase database) {
database.execSQL(
"CREATE TABLE timerecords"+"id INTEGER PRIMARY KEY, time TEXT, notes TEXT)"
);
}
@Override
public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) {
}
}
Is there any problem in above two file ? If has, please tell me what. And if not, please tell me how to fix this problem.
thanks 🙂
@Edit: I add my screenshot of my data folder. (No file in lib folder)

the database related issue will be solved by below updation in your code.
Regarding your app not visible in File explorer, you need to search by package name as below
n
data/data/com.app and here you can see database folder where you can see all your databases created by applicatio