Search code examples
androidsqliteopenhelper

unable to see Sqlite database in my Android's FileExplore


I am creating a Sqlite database and when i want to see that database using File_Explorer at that time , i am not getting it in that location only two folders are present there : Cache , lib , but database folder is not present there , but the point is that i am getting its location also , by LOGS ,

protected void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_db__creation);

    database db = new database(this);
}

// -- SqliteOpenHelper class ( extended )!

public database( Context context ) 
{
    super(context, "New_one.db" , null , 2 );
    Log.i("2nd class : constructor","tushar");
    Log.i(context.getDatabasePath("New_one.db").toString(),"tushar");

    //(data base location )
    ///data/data/com.example.database_creation/databases/New_one.db
}

public void onCreate(SQLiteDatabase db) 
{
    Log.i("2nd class : onCreate", "tushar");
    db.execSQL("create table timerecords " +"(id integer primary key, time text, notes text)");
}

public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) 
{
}

Solution

  • Just follow these steps,

    1. Using Devices, select the device/emulator where you are deploying your application.
    2. Go to DDMS-> file explorer-> data->data->see your package name-> databases->here your database file.