Android SQLiteQuery - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android SQLiteQuery class.

This code example shows how to use the following methods:toString
This code example shows how to use the following methods:toString
    private static final int DATABASE_VERSION = 1;
 
    private static final CursorFactory sCursorFactory = new CursorFactory() {
        @Override 
        public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery, String editTable, SQLiteQuery query) { 
            Log.d(TAG, query.toString()); 
            return new SQLiteCursor(db, masterQuery, editTable, query); 
        } 
    }; 
 
    interface Tables { 
        String FILES = "files";
    } 
 
    public FilesDatabase(Context context) {
        super(context, DATABASE_NAME, BuildConfig.DEBUG ? sCursorFactory : null, DATABASE_VERSION);
    } 
 
    @Override 
    public void onCreate(SQLiteDatabase db) {
4
CodeRank
This code example shows how to use the following methods:bindBlob
		if(b!=null){
			return b;
		} 
		SQLiteQuery s;
		s=hashCursor.getQuery();
		s.bindBlob(1, hash);
		hashCursor.requery();
		 
		if(hashCursor.getCount() == 0){
			 
			return null; 
		} 
		hashCursor.moveToFirst();
		b=createBlockFromCursor(hashCursor);
	 
		return b;
	} 
	 
	public synchronized Block getByPreviousHash(byte[] hash){
		sql.setLength(0);
5
CodeRank
This code example shows how to use the following methods:toString
	@SuppressWarnings("deprecation") 
	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	@Override 
	public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery, String editTable, SQLiteQuery query) {
		if (debugQueries) {
			Log.d("SQL", query.toString());
		} 
 
		if (AndroidUtil.getAndroidVersion() >= Build.VERSION_CODES.HONEYCOMB) {
			return new SQLiteCursor(masterQuery, editTable, query);
		} else { 
			return new SQLiteCursor(db, masterQuery, editTable, query);
		} 
	} 
} 
4
CodeRank
This code example shows how to use the following methods:toString
This code example shows how to use the following methods:toString
    private void logCursor(Cursor cursor, String[] selectionArgs) {
        try { 
            Field queryField = SQLiteCursor.class.getDeclaredField("mQuery");
            queryField.setAccessible(true);
            SQLiteQuery sqliteQuery = (SQLiteQuery) queryField.get((SQLiteCursor) cursor);
            Log.v(TAG, sqliteQuery.toString() + ": " + Arrays.toString(selectionArgs));
        } catch (Exception e) {
            Log.v(TAG, e.getMessage(), e);
        } 
    } 
 
    private void notifyChange(Uri uri) {
        String notify = uri.getQueryParameter(QUERY_NOTIFY);
        Log.v(TAG, "notifyChange: uri = " + uri + ", notify = " + notify);
        if (notify == null || "true".equals(notify)) {
            // Notify the uri which changed. 
            Set<Uri> urisToNotify = new HashSet<Uri>();
            urisToNotify.add(uri);
 
            // Whether a meeting, meeting_member, or meeting table was 
3
CodeRank
This code example shows how to use the following methods:toString
This code example shows how to use the following methods:toString
This code example shows how to use the following methods:toString
This code example shows how to use the following methods:toString

Related Android SQLiteQuery Questions & Answers:

See Code Examples for Android SQLiteQuery Methods: