Is it possible to config Gradle to build few android apk files where each would be using only one resource-type folder?
I mean:
- build-hdpi.apk
- build-mdpi.apk
- build-xhdpi.apk
I know I could simply remove certain folders before building, but it would be nice if I could make it "automagically".
Would it be possible with using gradle "flavors"?
Now we can also use api splits http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
Example From the docs link :
Example in AOSP: https://android.googlesource.com/platform/tools/base/+/2101d189d85dd46f865726b9b7aa0012832a6d9c/build-system/tests/regular/densitySplit/build.gradle
Its not yet possible, but 0.7.0 will have this feature.
You'll need to create 3 product flavors (or more if you want to support all densities), and you'll have a flavor property to restrict what to package in the apk.
0.7.0 will be out shortly.
Note that the Multi APK support in the Play Store does not support density as a filter, that would show up as 3 different apps on the store which is not what you'd want.Edit: this is actually supported by Multiple Apks: http://developer.android.com/google/play/publishing/multiple-apks.htmlEdit2: Now that 0.7.+ is out, you can do the following: