예제 #1
0
 private KJDB(DaoConfig config) {
   if (config == null) {
     throw new RuntimeException("daoConfig is null");
   }
   if (config.getContext() == null) {
     throw new RuntimeException("android context is null");
   }
   if (config.getTargetDirectory() != null && config.getTargetDirectory().trim().length() > 0) {
     this.db = createDbFileOnSDCard(config.getTargetDirectory(), config.getDbName());
   } else {
     this.db =
         new SqliteDbHelper(
                 config.getContext().getApplicationContext(),
                 config.getDbName(),
                 config.getDbVersion(),
                 config.getDbUpdateListener())
             .getWritableDatabase();
   }
   this.config = config;
 }