Android?????????????????
???????????? ???????[ 2015/1/15 13:39:06 ] ????????Android ??????? ?????
???????????μ???????
????1.??????????????г???AndroidTestCase
????2.??AndroidManifest.xml?????嵥??????????????
??????????manifest??????????instrumentation??targetPackage???????????????????????
????<instrumentation
????android:name="android.test.InstrumentationTestRunner"
????android:targetPackage="com.myandroid.db" />
?????????application??????????
????<uses-library android:name="android.test.runner" />
?????????????????
???????????????????????SQLiteOpenHelper?????????е????????
????????????У???????????????????????汾?????????????????汾???????????
????????????
public class PersonDBHelper extends SQLiteOpenHelper {
/**
* ??????????
* @param context ??????
* @param name ?????????
* @param factory ????????null????????????
* @param version ?????汾???С??1
*/
public PersonDBHelper(Context context?? String name?? CursorFactory factory??
int version) {
super(context?? name?? factory?? version);
// TODO ????????????????
}
//????δ???????????д????????????????????????
@Override
public void onCreate(SQLiteDatabase db) {
//?????????
db.execSQL("create table userInfo(id integer primary key autoincrement??username varchar(50)??telphone varchar(20)??createdate datetime)");
}
//????????汾?????仯?????
@Override
public void onUpgrade(SQLiteDatabase db?? int arg1?? int arg2) {
//??????????
db.execSQL("alter table userInfo add remark varchar(50)");
}
}
|
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11