Currently we are trying to split up our Android APK by API level so that less than or equal to 19 get's the PNG's and greater than 21 gets the new vector drawable XML's, since we are trying to reduce the footprint of our app. Currently, we are struggling to come up with a multiproject schema, as we haven't done that yet in the current project (kind of a big monolith). Has anyone seen any examples of this or provide advice on how exactly to split up the project? We want to use the same code for both, just split the resources.
this is aimed at everyone who will look at my post wondering the same thing I was. What we ended up doing was running have multiple configurations in the productFlavors
section. Here is how I set it up:
android {
...
productFlavors {
v15 {
minSdkVersion 15
vectorDrawables.useSupportLibrary = true
}
v21 {
minSdkVersion 21
}
}
}
This will generate multiple apk's in our build/outputs/apk
directory, one for each version we were looking for. Also, if you are doing this, you need to add a line to your dependency list:
dependencies {
...
compile 'com.android.support:appcompat-v7:23.2.0'
}
Good luck!
Edit: For those of you that want sources: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Product-flavors