Code example for SQLiteDatabase

Methods: deletereplace

    public void setString(String name, String value)
        ContentValues cv = new ContentValues();
        cv.put("key", name);
        cv.put("value", value);
        mDatabase.delete("settings", "key='" + name + "'", null);
        mDatabase.replace("settings", null, cv);
    public String getString(String name)
        return getString(name, null);
    public String getString(String name, String defaultValue)
        Cursor cursor = mDatabase.query("settings", new String[] { "value" }, "key='" + name + "'", null, null, null, null);
            if (cursor.moveToNext())
Connect your IDE to all the code out there  Get Codota for Java