Java tutorial
//package com.java2s; //License from project: Apache License import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.support.annotation.NonNull; import android.support.annotation.Nullable; public class Main { private static final String TABLE_RANGE = "range"; static final String COLUMN_REGION_CODE = "code"; static final String COLUMN_RANGE_START = "start"; static final String COLUMN_RANGE_CAPACITY = "capacity"; static final String COLUMN_OPERATOR = "operator"; static final String COLUMN_REGION = "region"; @Nullable static Cursor getRegionRanges(@NonNull SQLiteDatabase db, int regionCode) { return db.query(TABLE_RANGE, new String[] { COLUMN_RANGE_START, COLUMN_RANGE_CAPACITY, COLUMN_OPERATOR, COLUMN_REGION }, COLUMN_REGION_CODE + "=?", new String[] { String.valueOf(regionCode) }, null, null, null, null); } }