@@ -0,0 +1,984 @@
+package org.hisp.dhis.android.core.data.database;%0A%0Aimport android.content.Context;%0Aimport android.support.test.InstrumentationRegistry;%0A%0Aimport com.facebook.stetho.Stetho;%0A%0Apublic class DatabaseAdapterFactory %7B%0A    private static String dbName = null;%0A    private static DatabaseAdapter databaseAdapter = null;%0A%0A    private static DatabaseAdapter create() %7B%0A        Context context = InstrumentationRegistry.getTargetContext().getApplicationContext();%0A        DbOpenHelper dbOpenHelper = new DbOpenHelper(context, dbName);%0A        dbOpenHelper.getWritableDatabase();%0A        Stetho.initializeWithDefaults(context);%0A        return new SqLiteDatabaseAdapter(dbOpenHelper);%0A    %7D%0A%0A    public static DatabaseAdapter get(boolean foreignKeyConstraintsEnabled) %7B%0A        if (databaseAdapter == null) %7B%0A            databaseAdapter = create();%0A        %7D%0A%0A        databaseAdapter.database().setForeignKeyConstraintsEnabled(foreignKeyConstraintsEnabled);%0A%0A        return databaseAdapter;%0A    %7D%0A%7D

Add DatabaseAdapterFactory