mardi 21 avril 2015

Android whats URI in simple SqliteQueryBuilder class

Vote count: 0

i want to use simple SqliteQuery builder in this link, but in this page refer to developer we can simply use :

Cursor c = new QueryBuilder()
    .select( "_id" )
    .whereColumnEquals( "firstname", "Jesper" )
    .query( context, uri );

in this sample i dont know whats uri and i can not how to combine this class with my sqliteHelper class, i want to use QueryBuilder with my created database in this class:

public class SqliteHelper extends SQLiteOpenHelper {

    /**
     * CATEGORIES LIST Table
     */
    public static String TB_CATEGORY = "categories_list";
    //------------------ Field_Category_Id
    public static String F_C_ID = "_id";
    public static String F_C_TITLE = "title";
    public static String F_C_FOLLOWERS = "followers";
    public static String F_C_TYPE = "type";
    public static String F_C_DATE = "date";

    public  static String DATABASE_NAME = "db.sqlite";
    private static int DATABASE_VERSION = 3;

    public SqliteHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        ...
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        ...
    }
}

for example:

Cursor c = new QueryBuilder()
    .select( sqliteHelper.F_C_ID )
    .whereColumnEquals( "firstname", "Jesper" )
    .query( getBaseContext() , uri );

how to set correct uri for my sqlite helper class

asked 34 secs ago



Android whats URI in simple SqliteQueryBuilder class

Aucun commentaire:

Enregistrer un commentaire