开发者

Problem in Android Database creation. Please help

I am new to android. I implemented these steps to create a sqlite database,

public void onCreate(Bundle icicle){
    super.onCreate(icicle);
    setContentView(R.layout.main);
    SQLiteDatabase db;
    db = openOrCreateDatabase("TestData.db", SQLiteDatabase.CREATE_IF_NECESSARY, null);

   }

but the the database not made i searched the database at every location (in packcage also开发者_如何学Python), also checked with commands specified. # ls /com/testproject/action.TestAction/databases


I don't know why you are using this commands here but Android stores the database files in the directory:

/data/data/your_app_package_name/databases/

I assume if your application have com.testproject pakage name in your AndroidManifest.xml file then your database file path should be like this:

 /data/data/com.login/databases/TestData.db

So just insure that your db file is there or not.

Refer this : http://developer.android.com/guide/developing/tools/adb.html#sqlite


Check out this tutorial provided by Android Developers. It contains some useful information on general Android things, including how to create an SQLite DB

http://developer.android.com/resources/tutorials/notepad/index.html

The SQLite stuff is in Exercise 1.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜