Code example for SQLiteOpenHelper

Methods: getReadableDatabase

0
            } 
        }; 
    } 
 
    public SQLiteDatabase getReadableDatabase() {
        return openHelper.getReadableDatabase();
    } 
 
    public SQLiteDatabase getWritableDatabase() {
        return openHelper.getWritableDatabase();
    } 
 
    public boolean addPost(Post post) {
        // Abort if post exists 
        if (exists(post.getKey())) {
            Util.debug("  Post already exists, skipping."); 
            return false; 
        } 
        final SQLiteDatabase db = openHelper.getWritableDatabase();
        ContentValues cv = new ContentValues();
        cv.put(COL_KEY, post.getKey());