Question

I have a pretty complex project, it uses a lot of custom views and image manipulation. I want to have in it 2 type of in app purchases, one for Google Play and one for Amazon.

I want to be able to easily maintain code for both, so from what I see I have some options:

  • I can add both apis on the app and have a flag, based on which, when I build the APK I enable one or the other. Is Google Play sensing if I add Amazon API in the app ? Could this be a problem when uploading the apk ?

  • I can make the main project as a library project and then create two new projects which are using it. One for Google Play and one for Amazon. All changes will be made in the library project so code is easily maintainable

  • I can have two separate projects one for Google Play and one for Amazon. In this case it might be pretty hard to keep track of changes, but doable.

Which approach would be better and why ?

Was it helpful?

Solution

Go for the first option.

If the app you uploaded to Google Play uses Google Play for in-app billing, then you have no issues whatsoever, even if there is coding and permissions etc. for Amazon payment inside the app. Google doesn't analysis this. And event if they would, you are on the save side, as you only use Google Play's in-app billing.

You can even improve this option by using Android Studio and Gradle build. It allows to package only those artefacts, that you need for certain build variant. In your case, you can have a single version of project and configure Gradle in a way, that it creates two apk-files: one for Google Play and one for Amazon with respective payment logic in them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top