Android之数据存储
2010-08-25 23:55:00 来源:WEB开发网核心提示:db.execSQL(DICTIONARY_TABLE_CREATE);}}public class MyDbOpenHelper extends SQLiteOpenHelper {private static final int DATABASE_VERSION = 2;private static final S
db.execSQL(DICTIONARY_TABLE_CREATE);
}
}
public class MyDbOpenHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 2;
private static final String DICTIONARY_TABLE_NAME = "dictionary";
private static final String DICTIONARY_TABLE_CREATE =
"CREATE TABLE " + DICTIONARY_TABLE_NAME + " (" +
KEY_WORD + " TEXT, " +
KEY_DEFINITION + " TEXT);";
DictionaryOpenHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(DICTIONARY_TABLE_CREATE);
}
}
网络存储
一般利用网络获取数据或者通过网络上传数据,常用的类是:java.net.*,android.net.*
更多精彩
赞助商链接