public final class MLDB {
public static final String ACCOUNTS_TABLE = "accounts";
public static final String DESCRIPTION_HISTORY_TABLE = "description_history";
public final class MLDB {
public static final String ACCOUNTS_TABLE = "accounts";
public static final String DESCRIPTION_HISTORY_TABLE = "description_history";
SQLiteDatabase db = getDatabase();
try (Cursor cursor = db.rawQuery("select value from options where profile = ? and name=?",
new String[]{NO_PROFILE, name}))
SQLiteDatabase db = getDatabase();
try (Cursor cursor = db.rawQuery("select value from options where profile = ? and name=?",
new String[]{NO_PROFILE, name}))
- Log.d("option", String.format("%s := %s", name, value));
+ debug("option", String.format("%s := %s", name, value));
SQLiteDatabase db = MLDB.getDatabase();
db.execSQL("insert or replace into options(profile, name, value) values(?, ?, ?);",
new String[]{NO_PROFILE, name, value});
SQLiteDatabase db = MLDB.getDatabase();
db.execSQL("insert or replace into options(profile, name, value) values(?, ?, ?);",
new String[]{NO_PROFILE, name, value});
String[] col_names = {FontsContract.Columns._ID, field};
MatrixCursor c = new MatrixCursor(col_names);
String[] col_names = {FontsContract.Columns._ID, field};
MatrixCursor c = new MatrixCursor(col_names);
"ORDER BY 2, 1;", field, field, field, field, table, field);
params = new String[]{str, str, str, str};
}
"ORDER BY 2, 1;", field, field, field, field, table, field);
params = new String[]{str, str, str, str};
}
SQLiteDatabase db = MLDB.getDatabase();
try (Cursor matches = db.rawQuery(sql, params)) {
SQLiteDatabase db = MLDB.getDatabase();
try (Cursor matches = db.rawQuery(sql, params)) {
while (matches.moveToNext()) {
String match = matches.getString(0);
int order = matches.getInt(1);
while (matches.moveToNext()) {
String match = matches.getString(0);
int order = matches.getInt(1);
- Log.d("autocompletion", String.format("match: %s |%d", match, order));
+ debug("autocompletion", String.format("match: %s |%d", match, order));
private static final String DB_NAME = "MoLe.db";
private static final int LATEST_REVISION = 22;
private static final String CREATE_DB_SQL = "create_db";
private static final String DB_NAME = "MoLe.db";
private static final int LATEST_REVISION = 22;
private static final String CREATE_DB_SQL = "create_db";
public MobileLedgerDatabase(Application context) {
super(context, DB_NAME, null, LATEST_REVISION);
public MobileLedgerDatabase(Application context) {
super(context, DB_NAME, null, LATEST_REVISION);
applyRevisionFile(db, CREATE_DB_SQL);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
applyRevisionFile(db, CREATE_DB_SQL);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
throw new SQLException(String.format(Locale.US, "No resource for %s", rev_file));
db.beginTransaction();
try (InputStream res = rm.openRawResource(res_id)) {
throw new SQLException(String.format(Locale.US, "No resource for %s", rev_file));
db.beginTransaction();
try (InputStream res = rm.openRawResource(res_id)) {