android.database.sqlite.SQLiteDatabase.CursorFactory Java Examples

The following examples show how to use android.database.sqlite.SQLiteDatabase.CursorFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ContextImpl.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory,
        DatabaseErrorHandler errorHandler) {
    checkMode(mode);
    File f = getDatabasePath(name);
    int flags = SQLiteDatabase.CREATE_IF_NECESSARY;
    if ((mode & MODE_ENABLE_WRITE_AHEAD_LOGGING) != 0) {
        flags |= SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING;
    }
    if ((mode & MODE_NO_LOCALIZED_COLLATORS) != 0) {
        flags |= SQLiteDatabase.NO_LOCALIZED_COLLATORS;
    }
    SQLiteDatabase db = SQLiteDatabase.openDatabase(f.getPath(), factory, flags, errorHandler);
    setFilePermissionsFromMode(f.getPath(), mode, 0);
    return db;
}
 
Example #2
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 6 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory,
        DatabaseErrorHandler errorHandler) {
    checkMode(mode);
    File f = getDatabasePath(name);
    int flags = SQLiteDatabase.CREATE_IF_NECESSARY;
    if ((mode & MODE_ENABLE_WRITE_AHEAD_LOGGING) != 0) {
        flags |= SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING;
    }
    if ((mode & MODE_NO_LOCALIZED_COLLATORS) != 0) {
        flags |= SQLiteDatabase.NO_LOCALIZED_COLLATORS;
    }
    SQLiteDatabase db = SQLiteDatabase.openDatabase(f.getPath(), factory, flags, errorHandler);
    setFilePermissionsFromMode(f.getPath(), mode, 0);
    return db;
}
 
Example #3
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 6 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory,
        DatabaseErrorHandler errorHandler) {
    checkMode(mode);
    File f = getDatabasePath(name);
    int flags = SQLiteDatabase.CREATE_IF_NECESSARY;
    if ((mode & MODE_ENABLE_WRITE_AHEAD_LOGGING) != 0) {
        flags |= SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING;
    }
    if ((mode & MODE_NO_LOCALIZED_COLLATORS) != 0) {
        flags |= SQLiteDatabase.NO_LOCALIZED_COLLATORS;
    }
    SQLiteDatabase db = SQLiteDatabase.openDatabase(f.getPath(), factory, flags, errorHandler);
    setFilePermissionsFromMode(f.getPath(), mode, 0);
    return db;
}
 
Example #4
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory,
        DatabaseErrorHandler errorHandler) {
    File f = validateFilePath(name, true);
    int flags = SQLiteDatabase.CREATE_IF_NECESSARY;
    if ((mode & MODE_ENABLE_WRITE_AHEAD_LOGGING) != 0) {
        flags |= SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING;
    }
    SQLiteDatabase db = SQLiteDatabase.openDatabase(f.getPath(), factory, flags, errorHandler);
    setFilePermissionsFromMode(f.getPath(), mode, 0);
    return db;
}
 
Example #5
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory,
        DatabaseErrorHandler errorHandler) {
    File f = validateFilePath(name, true);
    int flags = SQLiteDatabase.CREATE_IF_NECESSARY;
    if ((mode & MODE_ENABLE_WRITE_AHEAD_LOGGING) != 0) {
        flags |= SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING;
    }
    SQLiteDatabase db = SQLiteDatabase.openDatabase(f.getPath(), factory, flags, errorHandler);
    setFilePermissionsFromMode(f.getPath(), mode, 0);
    return db;
}
 
Example #6
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory,
        DatabaseErrorHandler errorHandler) {
    File f = validateFilePath(name, true);
    SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(f.getPath(), factory, errorHandler);
    setFilePermissionsFromMode(f.getPath(), mode, 0);
    return db;
}
 
Example #7
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory,
        DatabaseErrorHandler errorHandler) {
    File f = validateFilePath(name, true);
    int flags = SQLiteDatabase.CREATE_IF_NECESSARY;
    if ((mode & MODE_ENABLE_WRITE_AHEAD_LOGGING) != 0) {
        flags |= SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING;
    }
    SQLiteDatabase db = SQLiteDatabase.openDatabase(f.getPath(), factory, flags, errorHandler);
    setFilePermissionsFromMode(f.getPath(), mode, 0);
    return db;
}
 
Example #8
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory,
        DatabaseErrorHandler errorHandler) {
    File f = validateFilePath(name, true);
    int flags = SQLiteDatabase.CREATE_IF_NECESSARY;
    if ((mode & MODE_ENABLE_WRITE_AHEAD_LOGGING) != 0) {
        flags |= SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING;
    }
    SQLiteDatabase db = SQLiteDatabase.openDatabase(f.getPath(), factory, flags, errorHandler);
    setFilePermissionsFromMode(f.getPath(), mode, 0);
    return db;
}
 
Example #9
Source File: CustomContextWrapper.java    From Neptune with Apache License 2.0 5 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory) {
    File databaseDir = new File(getPluginPackageInfo().getDataDir() + DATABASE_PATH);
    if (!databaseDir.exists()) {
        databaseDir.mkdirs();
    }
    // backup database for old version start
    checkBackupDB(name);
    // backup database for old version end
    return super.openOrCreateDatabase(databaseDir.getAbsolutePath() + "/" + name, mode, factory);
}
 
Example #10
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory,
        DatabaseErrorHandler errorHandler) {
    File f = validateFilePath(name, true);
    int flags = SQLiteDatabase.CREATE_IF_NECESSARY;
    if ((mode & MODE_ENABLE_WRITE_AHEAD_LOGGING) != 0) {
        flags |= SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING;
    }
    SQLiteDatabase db = SQLiteDatabase.openDatabase(f.getPath(), factory, flags, errorHandler);
    setFilePermissionsFromMode(f.getPath(), mode, 0);
    return db;
}
 
Example #11
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory,
        DatabaseErrorHandler errorHandler) {
    File f = validateFilePath(name, true);
    int flags = SQLiteDatabase.CREATE_IF_NECESSARY;
    if ((mode & MODE_ENABLE_WRITE_AHEAD_LOGGING) != 0) {
        flags |= SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING;
    }
    SQLiteDatabase db = SQLiteDatabase.openDatabase(f.getPath(), factory, flags, errorHandler);
    setFilePermissionsFromMode(f.getPath(), mode, 0);
    return db;
}
 
Example #12
Source File: InstrActivityProxy1.java    From Neptune with Apache License 2.0 4 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory,
                                           DatabaseErrorHandler errorHandler) {
    return mPluginContextWrapper.openOrCreateDatabase(name, mode, factory, errorHandler);
}
 
Example #13
Source File: DaoMaster.java    From MaoWanAndoidClient with Apache License 2.0 4 votes vote down vote up
public DevOpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory);
}
 
Example #14
Source File: DaoMaster.java    From MaoWanAndoidClient with Apache License 2.0 4 votes vote down vote up
public OpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory, SCHEMA_VERSION);
}
 
Example #15
Source File: DaoMaster.java    From KotlinMVPRxJava2Dagger2GreenDaoRetrofitDemo with Apache License 2.0 4 votes vote down vote up
public DevOpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory);
}
 
Example #16
Source File: DaoMaster.java    From ClassSchedule with Apache License 2.0 4 votes vote down vote up
public OpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory, SCHEMA_VERSION);
}
 
Example #17
Source File: FabricContext.java    From letv with Apache License 2.0 4 votes vote down vote up
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory) {
    return SQLiteDatabase.openOrCreateDatabase(getDatabasePath(name), factory);
}
 
Example #18
Source File: NoLocaleSqliteContext.java    From LaunchEnr with GNU General Public License v3.0 4 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(
        String name, int mode, CursorFactory factory, DatabaseErrorHandler errorHandler) {
    return super.openOrCreateDatabase(
            name, mode | Context.MODE_NO_LOCALIZED_COLLATORS, factory, errorHandler);
}
 
Example #19
Source File: DaoMaster.java    From sctalk with Apache License 2.0 4 votes vote down vote up
public DevOpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory);
}
 
Example #20
Source File: DaoMaster.java    From enjoyshop with Apache License 2.0 4 votes vote down vote up
public DevOpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory);
}
 
Example #21
Source File: DaoMaster.java    From frpc-Android with Apache License 2.0 4 votes vote down vote up
public OpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory, SCHEMA_VERSION);
}
 
Example #22
Source File: InstrActivityProxy1.java    From Neptune with Apache License 2.0 4 votes vote down vote up
@Override
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory) {

    return mPluginContextWrapper.openOrCreateDatabase(name, mode, factory);
}
 
Example #23
Source File: ClaseSQLiteBD1.java    From programming with GNU General Public License v3.0 4 votes vote down vote up
public ClaseSQLiteBD1(Context context, String name, CursorFactory factory,
                      int version) {
    super(context, DataBaseName, factory, dbversion);
    // TODO Auto-generated constructor stub
}
 
Example #24
Source File: DaoMaster.java    From Awesome-WanAndroid with Apache License 2.0 4 votes vote down vote up
public DevOpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory);
}
 
Example #25
Source File: DaoMaster.java    From Awesome-WanAndroid with Apache License 2.0 4 votes vote down vote up
public OpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory, SCHEMA_VERSION);
}
 
Example #26
Source File: DaoMaster.java    From DMusic with Apache License 2.0 4 votes vote down vote up
public OpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory, SCHEMA_VERSION);
}
 
Example #27
Source File: JarContext.java    From letv with Apache License 2.0 4 votes vote down vote up
public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory) {
    return this.mConctext.openOrCreateDatabase(name, mode, factory);
}
 
Example #28
Source File: DBHelper.java    From VideoOS-Android-SDK with GNU General Public License v3.0 4 votes vote down vote up
public static synchronized DBHelper getInstance(Context context, String name, int version, List<String> databaseCreate, CursorFactory factory) {
    if (dbHelper == null) {
        dbHelper = new DBHelper(context, name, version, databaseCreate, factory);
    }
    return dbHelper;
}
 
Example #29
Source File: DBHelper.java    From VideoOS-Android-SDK with GNU General Public License v3.0 4 votes vote down vote up
private DBHelper(Context context, String name, int version, List<String> databaseCreate, CursorFactory factory) {
    super(context, name, factory, version);
    this.databaseCreate = databaseCreate;
}
 
Example #30
Source File: DaoMaster.java    From Memory-capsule with Apache License 2.0 4 votes vote down vote up
public DevOpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory);
}