Code example for SQLiteDatabase

Methods: insertupdate

0
		values.put(Fields.USER, user);
		values.put(Fields.GROUP, group);
		values.put(Fields.REGEXP, regexp ? 1 : 0);
		values.put(Fields.SOUND, sound.toString());
		if (id == null)
			return db.insert(NAME, Fields.VALUE, values);
		db.update(NAME, values, Fields._ID + " = ?",
				new String[] { String.valueOf(id) });
		return id;
	} 
 
	void remove(long id) {
		SQLiteDatabase db = databaseManager.getWritableDatabase();
		db.delete(NAME, Fields._ID + " = ?",
				new String[] { String.valueOf(id) });
	} 
 
	@Override 
	protected String getTableName() {
		return NAME;
	}