What would be a good strategy for both Google Play and Amazon App Store builds from a single codebase

105 Views Asked by At

Looking for an upto date strategy for publishing my app to both Google Play and Amazon App Store (and possibly others). My app currently uses Google Play IAP, which works well for mass market Google Play, I'm planning on NOT taking this approach for Amazon, merely offering a free version and a full version as separate apps. My current codebase would also support this quite well.

My initial approach would be to create separate BuildTypes in the gradle file, with some types including the Google Billing and other builds not including the code and implementation dependency. However I couldn't find much on how to add conditional dependencies and conditional code, so my gut feel is I may have approached this incorrectly.

Does anyone how a working strategy on how best to manage this, without having to maintain 2 code branches.

Thanks.

1

There are 1 best solutions below

0
user16930239 On

Use Build Flavors & Variants.

Android Studio: ViewTool WindowsBuild Variants enter image description here

This is an example of how would you see it: enter image description here

Also check out this answer