Im new to android and I want to create kind of CRUD with SQLite.
I have a public class DataBaseHelper
which have a constructor:
public D
here I am writing two ways to get the path.
(1) using custom method
public String getDbPath(Context context,String YourDbName)
{
return context.getDatabasePath(YourDbName).getAbsolutePath();
}
(2) using File class
File path=context.getDatabasePath("YourDbName");
String db_path=path.getAbsolutePath();
Log.i("Path:",db_path);
even you will see the both code ...then both code is same, 1st one is the shortcut method to get the database path, and it's occupy the less memory compare to second option.