Search in sources :

Example 51 with SQLiteDatabase

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;
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase)

Example 52 with SQLiteDatabase

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);
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase) Cursor(android.database.Cursor)

Example 53 with SQLiteDatabase

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);
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase)

Example 54 with SQLiteDatabase

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);
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase) Cursor(android.database.Cursor)

Example 55 with SQLiteDatabase

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();
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase)

Aggregations

SQLiteDatabase (android.database.sqlite.SQLiteDatabase)1658 Cursor (android.database.Cursor)527 ContentValues (android.content.ContentValues)350 ArrayList (java.util.ArrayList)111 File (java.io.File)65 Test (org.junit.Test)59 SQLiteException (android.database.sqlite.SQLiteException)48 SQLException (android.database.SQLException)44 SQLiteQueryBuilder (android.database.sqlite.SQLiteQueryBuilder)44 Uri (android.net.Uri)44 IOException (java.io.IOException)43 ServiceStatus (com.vodafone360.people.service.ServiceStatus)42 SQLiteOpenHelper (android.database.sqlite.SQLiteOpenHelper)38 RemoteException (android.os.RemoteException)36 Pair (android.util.Pair)31 MediumTest (android.test.suitebuilder.annotation.MediumTest)30 Account (android.accounts.Account)29 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)25 ContactDetail (com.vodafone360.people.datatypes.ContactDetail)22 HashMap (java.util.HashMap)21