I am new to SQLite database in Android and I want know where is my database file (.db)is created .
below is part of my code
package com.navigationsystem;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase;
import android.hardware.SensorManager;
public class DatabaseHelper extends SQLiteOpenHelper {
private static final String DATABASE_NAME="db";
public static final String NODE_ID="nodeID";
//public static final String VALUE="value";
public static final String CHILD_ID="childID";
public static final String PARENT_ID="parentID";
public DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
//db.execSQL("CREATE TABLE constants (_id INTEGER PRIMARY KEY AUTOINCREMENT,title TEXT, value REAL);");
db.execSQL("CREATE TABLE nodes( nodeID CHAR(1) PRIMARY KEY );");
db.execSQL("CREATE TABLE edges( childID CHAR(1) NOT NULL, parentID CHAR(1) NOT NULL,PRIMARY KEY(childID,parentID) );");
ContentValues cv=new ContentValues();
......................
please give me details.
thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…