WEB开发网
开发学院手机开发Android 开发 Android之数据存储 阅读

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.*

上一页  1 2 3 4 

Tags:Android 数据 存储

编辑录入:coldstar [复制链接] [打 印]
赞助商链接