protected void createHelper ( DataSourceOptions options ) { if ( KriptonLibrary . getContext ( ) == null ) throw new KriptonRuntimeException ( "Kripton library is not properly initialized. Please use KriptonLibrary.init(context) somewhere at application startup" ) ; if ( options . inMemory ) { Logger . info ( "In-memory database" ) ; } else { File dbFile = KriptonLibrary . getContext ( ) . getDatabasePath ( name ) ; Logger . info ( "Database file %s" , dbFile . getAbsolutePath ( ) ) ; } sqliteHelper = new SQLiteOpenHelper ( KriptonLibrary . getContext ( ) , name , options . factory , version , options . errorHandler ) { @ Override public void onConfigure ( SQLiteDatabase database ) { AbstractDataSource . this . database = database ; AbstractDataSource . this . onConfigure ( database ) ; } @ Override public void onCreate ( SQLiteDatabase database ) { AbstractDataSource . this . onCreate ( database ) ; } @ Override public void onDowngrade ( SQLiteDatabase database , int oldVersion , int newVersion ) { AbstractDataSource . this . onDowngrade ( database , oldVersion , newVersion ) ; } @ Override public void onUpgrade ( SQLiteDatabase database , int oldVersion , int newVersion ) { AbstractDataSource . this . onUpgrade ( database , oldVersion , newVersion ) ; } } ; }
Creates the helper .