Android?????????洢????SQLite?????
???????????? ???????[ 2014/6/23 13:31:54 ] ????????Android SQLite ?????
????// ===============SQLite??????????=====================
/**
* ??????????
*/
public void transation(){
db.beginTransaction();
try {
//name???????????С?????
ContentValues contentValues=new ContentValues();
contentValues.put("money"?? 1000);
db.update("person"?? contentValues?? "name=?"?? new String[]{"???"});
ContentValues contentValues2=new ContentValues();
contentValues2.put("money"?? 1100);
db.update("person"?? contentValues2?? "name=?"?? new String[]{"С??"});
//???????????????????????????????????????????????
db.setTransactionSuccessful();
} finally {
//?????????????????е???setTransactionSuccessful()??????????????????????????????
db.endTransaction();
}
}
}
MyOpenHelper.java
**SQLiteOpenHelper:
* A helper class to manage database creation and version management.
* ?????SQLiteOpenHelper?????????????????????????????????????????????
*/
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
public class MyOpenHelper extends SQLiteOpenHelper {
//name:??????????????
//factory???α???
//version???汾?????????????1
public MyOpenHelper(Context context?? String name?? CursorFactory factory?? int version) {
super(context?? name?? factory?? version);
// TODO Auto-generated constructor stub
}
//????????????
@Override
public void onCreate(SQLiteDatabase db) {
//???????person??
db.execSQL("create table person(_id integer primary key autoincrement?? name char(10)?? phone char(20))");
System.out.println("oncreate??????");
}
//??????????????
@Override
public void onUpgrade(SQLiteDatabase db?? int oldVersion?? int newVersion) {
// TODO Auto-generated method stub
System.out.println("onupgrade??????");
db.execSQL("alter table person add money char(20)");
}
}
|
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Android???????????????Щ???????????Android????????????????????????Щ??Android ??????????????????????????APP?????android???????????????Android App ?????????Android Unit Test ?????Android?????????Robolectric3.0????(?)Android??????????????Android Studio???????????Android????MySQL????????????????Android MVP???????Android ?????????ActiveAndroid??дAndroid??????????????????????Android????????Java??????????Android????????Java8Java / Android ????????????????Щ??
???·???
??????????????????
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????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????