//创建数据库:
String sql = “create table person(id integer primary key autoincrement,name varchar(64),address varchar(64))”;
//插入:
database = helper.getWritableDatabase();//实现对数据库写的操作
String sql = “insert into person(name,address,sex) values(?,?,?)”;
database.execSQL(sql, params);
//删除:
String sql = “delete from person where id = ?”;
database = helper.getWritableDatabase();
database.execSQL(sql, params);
//查询:
String sql = “select * from person where id = ?”;//通过id查询
database = helper.getReadableDatabase();
cursor = database.rawQuery(sql, selectionArgs);//Cursor:是每一行的集
String sql = “select * from person”;//获取全部联系人
SQLiteDatabase database = null;
database = helper.getReadableDatabase();
cursor = database.rawQuery(sql, selectionArgs);