code: static void query(SQLiteDatabase db, String conditions, QueryType type, OnResultListener listener) {
  		String query = String.format(
  				"SELECT name, sql FROM sqlite_master WHERE type='%s'and name!='sqlite_sequence' and name!='android_metadata'%s",
  				type.toString().toLowerCase(), StringUtils.hasText(conditions) ? " AND " + conditions : "");
  		try (Cursor cursor = db.rawQuery(query, null)) {
  			if (cursor.moveToFirst()) {
  				int index0 = cursor.getColumnIndex("name");
  				int index1 = cursor.getColumnIndex("sql");
  				do {
  					listener.onRow(db, cursor.getString(index0), cursor.getString(index1));
  				} while (cursor.moveToNext());
  			}
  		}
  	}
docs: Query.
  
  @param db
  the db
  @param conditions
  the conditions
  @param type
  the type
  @param listener
  the listener