建立SQLite資料庫
阿新 • • 發佈:2018-12-11
package liziqiang.bawei.com.lziqiang20180921;
import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper;
public class DBhelper extends SQLiteOpenHelper {
public DBhelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) { super(context, name, factory, version); } @Override public void onCreate(SQLiteDatabase sqLiteDatabase) { sqLiteDatabase.execSQL("create table news (id integer primary key autoincrement,data text)"); } @Override public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) { }
}