Code example for SQLiteStatement

Methods: simpleQueryForString

0
		SQLiteStatement statement = db.compileStatement("SELECT " + TableSettings.VALUE + 
				" FROM " + TableSettings.TABLE_NAME + " WHERE " + TableSettings.KEY + "='" +
				TableSettings.APPLICATION_DIRECTORY + "'");
		String dir;
		try { 
			dir = statement.simpleQueryForString();
		} catch (SQLiteDoneException e) {
			dir = decipherApplicationDirectory();
			ContentValues insertValues = new ContentValues();
			insertValues.put(TableSettings.KEY, TableSettings.APPLICATION_DIRECTORY);
			insertValues.put(TableSettings.VALUE, dir);
			db.insert(TableSettings.TABLE_NAME, null, insertValues);
		} 
		return dir;
	} 
	 
	public void setCurrentFile(long id) {
		SQLiteDatabase db = mHelper.getWritableDatabase();
		int currentFileCount = db.rawQuery("SELECT value FROM settings WHERE key='currentFile'", null).getCount();
		if (currentFileCount < 1) {
			ContentValues insertValues = new ContentValues();