?????????????SQLite??Android?豸?п?????????????????洢????????????????????

????????????????????????Android ?????????????????????????????Щ?????????????????????????????Щ?????У???????-???????????ó????????????(?????????????????app??????/data/data/???′?????????У????????ó?????AndroidManifest.xml????е?package???)????????????SDcard??;Preferences?????????????????洢??????????????????????????????????????e????????????;?????????????????Assets??????????洢?Щ????????Assets?????Щ??assets???μ????????Щ?????????????????????????????????????ó??????е???????????????????????????????Щ??????????

???????????????????????????????????Щ?????????????????????????????????????Preference????????hold????Χ??????????Щ?????Ч????????????????????????????????????????????

??????Android1.5(????Cupcake)?????Android???SQLite(?汾3.5.9+)?????????SQLite??????????????????????????????????????????????????????????SQL??????????????SQLite?????????????????????Android???????????????????????????????

?????????У????????????Android?????SQLite????????????????????????????????????????????(update)(??????????????????2???????????update??????????????????????????????????????????????е?update??upgrade???????????????????????????????????)??????????Щ????????????

????????SQLite

???????????????????????SQLiteOpenHelper??????????SQLite????????????????????????????????????????????????????onCreate??onUpgrade????.

??????????????Щ?????е????????е??????????????????е?????????????????????????????

????Context?? ??????ó???????????????????б???????????????????????á?

???????????????????????????????????????????????????

?????α?factory?????????????????????????α?

?????????汾???????????????汾(????????????)??????????????????????????????1??

????????????????У???????????????????????????
 
class DB extends SQLiteOpenHelper {
 
  final static int DB_VERSION = 1;
  final static String DB_NAME = "mydb.s3db";
  Context context;
 
  public DB(Context context) {
      super(context?? DB_NAME?? null?? DB_VERSION);
      // Store the context for later use
      this.context = context;
}