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)
{
}
Just follow these steps,