I know the question is rather old but I believe this issue is still present.
I created a development tool that you can integrate as a lib into your android app project. The tool opens a server socket in your app to communicate via web browser. You can browse through your whole database and download the database file directly through the browser.
Integration can be done via jitpack.io:
project build.gradle:
//...
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
}
//...
app build.gradle:
//...
dependencies {
//...
debugCompile 'com.github.sanidgmbh:debugghost:v1.1'
//...
}
//...
In order to only compile DebugGhostLib in certain build-types or product-flavours we need an abstract Application class which will be derived in the special flavours. Put the following class in your main
folder (under java
> your.app.package
):
public class AbstractDebugGhostExampleApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Do your general application stuff
}
}
Now, for your release build type (or product flavour), you add the following Application class to your release
(or product-flavour) folder (also under java
> your.app.package
):
public class MyApp extends AbstractDebugGhostExampleApplication {
@Override
public void onCreate() {
super.onCreate();
}
}
This is the application class that will not reference DebugGhostLib.
Also tell your AndroidManifest.xml
that you're using your own application class. This will be done in your main
folder:
<manifest package="demo.app.android.sanid.com.debugghostexample" xmlns:android="http://schemas.android.com/apk/res/android">
<!-- permissions go here -->
<application android:name=".MyApp"> <!-- register your own application class -->
<!-- your activities go here -->
</application>
</manifest>
Now, for your debug build type (or product flavour), you add the following Application class to your debug
(or product-flavour) folder (also under java
> your.app.package
):
public class MyApp extends AbstractDebugGhostExampleApplication {
private DebugGhostBridge mDebugGhostBridge;
@Override
public void onCreate() {
super.onCreate();
mDebugGhostBridge = new DebugGhostBridge(this, MyDatabaseHelper.DATABASE_NAME, MyDatabaseHelper.DATABASE_VERSION);
mDebugGhostBridge.startDebugGhost();
}
}
You can get the tool here.