搜尋此網誌

2012年11月7日 星期三

open sqlite database file (打開sqlite database的檔案)

Step 1:
File dbfile = new File("/sdcard/dbname.sqlite" ); 
SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(dbfile, null);

Step 2:

Write this permission expression in the AndroidManiFest.xml if you want to write a file into

device.



<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>



constraint failed

代表primary key 已經存在於table了.