Code example for SQLiteOpenHelper

Methods: close

        helper = new DBOpenHelper(context);
    public void close() { 
        if (helper != null)
    public void open() { 
        if(helper == null)
            helper = new DBOpenHelper(context);
    public Cursor query(String[] projection, String selection, String[] selectionArgs, String sortOrder) {
        SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
        SQLiteDatabase db = helper.getReadableDatabase();
        Cursor cursor = qb.query(db, projection, selection, selectionArgs, null, null, sortOrder);
        return cursor;
Connect your IDE to all the code out there  Get Codota for Java