jeudi 4 février 2016

can i specify a path to sqlite database

I created sqlite database in android as shown in the code below and i added some records to it. then i wanted to copy that database to use it in anothe application, my database is called "GEOLOC.db" and i searched for it but it was not found despite it contains data.

please let me know

1-how to know where the sqlite database is saved

2-can i specify a path to which the databse will be saved?

code:

public class SQLiteHelper extends SQLiteOpenHelper {

private final String TAG = this.getClass().getSimpleName();

private static final int DATABASE_VERSION = 2;
private static final String DATABASE_NAME = "GEOLOC.db";//can i specify a pth here??
private static final String DATABASE_TABLE_NAME = "NODE_00";

private Context mCtx = null;

public SQLiteHelper(Context context) {
    super(context, DATABASE_NAME, null, DATABASE_VERSION);
    this.mCtx = context;
}

Aucun commentaire:

Enregistrer un commentaire