???????????μ???????
????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)");
}
}