I have an application that has free and priced products, I need to create two APKs for my application and show the application that supports In-App Billing in the countries that support it and show another APK of the same application that doesn't support In-App Billing (It has only the free products) in the countries that don't support it.
Can I use the Android Market Multiple APK Support feature to achieve this? If not, is there any feasible suggestions other than creating tow separate applications?
Multiple APKs is a feature on Google Play that allows developers to upload multiple APKs based on pixel density, locale, ABI, API levels, etc. Android Developers documentation lists many rules that developers need to address before publishing APKs on Google Play.
SAI (Split APKs Installer) is an App that lets you install multiple APKs as if it was a single Package.
Each APK must have a different version code, specified by the android:versionCode attribute. Each APK must not exactly match the configuration support of another APK. That is, each APK must declare slightly different support for at least one of the supported Google Play filters (listed above).
Multiple APK feature AFAIK does not support filtering country at least in the current release. Check out Supported filters and Rules for multiple APKs for more details.
If you are going to build two apks anyway. It is much simpler and easy-maintainable to publish them as two standalone application (where you can differ and set available country for each in developer console), other than using Multiple APK feature (says even it supports filtering country in the future release). A normal way people used to avoid duplicate code is using Android Library Project.
If you only want to build and publish a single apk for all cases. a feasible solution could be maintain a supported country list in project resource and add some conditional branch to enable/disable in-app billing code based on the country list, and acknowledge user with some UI warning at runtime, something like:
if (isInSupportedCountryList()) { setInAppBillingOn(); } else { setInAppBillingOff(); }
As you can see, this needs (even not necessary) updates/re-publish every time new countries are supporting or removed by Google.
I think the easiest thing would be to just upload two separate applications and then use the "Publishing Options" to select which countries you want to have each version. Then you can add and remove either application on a 'per country' basis.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With