Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
204 views
in Technique[技术] by (71.8m points)

android - Where is my database file in SQLite

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

See below image. it may help you.

DDMS


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...