I'm creating a very simple app with a free and paid version, for this I'm using the great productFlavors feature in the Android Gradle plugin. I understand how the build.gradle file should be configured and have written it so my build options are;
- freeRelease
- freeDebug
- paidRelease
- PaidDebug
that looks as follows
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.someconfig
}
}
productFlavors {
free {
packageName "com.somepackagename.appfree"
}
paid {
packageName "com.somepackagename.appPaid"
}
}
Basically, all I'm trying to do is restrict a few features and add AdMod to the free version, how would I do that? Do I add if-else statements in my main java classes that check to see if it's free or paid? or can I overwrite java classes in the free directory? How should I go about doing this?