use of android.database.sqlite.SQLiteDatabase in project platform_packages_apps_launcher by android.
the class LauncherProvider method update.
@Override
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
SqlArguments args = new SqlArguments(uri, selection, selectionArgs);
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
int count = db.update(args.table, values, args.where, args.args);
if (count > 0)
sendNotify(uri);
return count;
}
use of android.database.sqlite.SQLiteDatabase in project android-sms-relay by nyaruka.
the class TextMessageHelper method withId.
public TextMessage withId(Long id) {
final SQLiteDatabase readableDatabase = getReadableDatabase();
final Cursor cursor = readableDatabase.query("messages", TEXT_MESSAGE_COLS, "id = ?", new String[] { id.toString() }, null, null, null, null);
return firstFromCursor(cursor);
}
use of android.database.sqlite.SQLiteDatabase in project android-sms-relay by nyaruka.
the class TextMessageHelper method clearMessages.
public void clearMessages() {
final SQLiteDatabase writableDatabase = getWritableDatabase();
writableDatabase.delete("messages", null, null);
}
use of android.database.sqlite.SQLiteDatabase in project android-sms-relay by nyaruka.
the class TextMessageHelper method withStatus.
public List<TextMessage> withStatus(Context context, char direction, char status) {
final SQLiteDatabase readableDatabase = getReadableDatabase();
final Cursor cursor = readableDatabase.query("messages", TEXT_MESSAGE_COLS, "direction = ? AND status = ?", new String[] { "" + direction, "" + status }, null, null, "id DESC", "100");
return listFromCursor(cursor);
}
use of android.database.sqlite.SQLiteDatabase in project android-demos by novoda.
the class DatabaseCleaner method clean.
public void clean() throws SQLException {
SQLiteDatabase sqLiteDatabase = dbHelper.getWritableDatabase();
for (String table : TABLES) {
sqLiteDatabase.delete(table, null, null);
}
dbHelper.close();
}
Aggregations