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.
Use Build Flavors & Variants.
Android Studio:
View▸Tool Windows▸Build VariantsThis is an example of how would you see it:
Also check out this answer