Setup
To add this extension all you have to do is add the following dependency:
implementation 'com.femastudios:dataflow-android:1.0.6'
Also you'll need to add the following compile and packaging options:
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
freeCompilerArgs += '-Xjvm-default=enable'
}
packagingOptions {
exclude 'META-INF/library_release.kotlin_module'
}
}
Remember also to add our server to the repositories, as explained here
Since our libraries contain a lot of methods it is suggested to use Proguard to automatically remove the ones you don't use.
To enable proguard:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-debug.pro'
}
}
Also, add these lines to your proguard-rules-debug.pro
if you want to keep seeing methods and class names during debug:
-keepattributes SourceFile,LineNumberTable
-keepattributes LocalVariableTable,LocalVariableTypeTable
-keepnames class ** { *; }
If even after applying Proguard you still exceed the Android™'s limited 64K number of methods you should enable multidexing.