Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to have multiple APK support based on country?

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?

like image 404
Mahdi Hijazi Avatar asked Oct 09 '11 11:10

Mahdi Hijazi


People also ask

What is multi APK?

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.

What is split config APK?

SAI (Split APKs Installer) is an App that lets you install multiple APKs as if it was a single Package.

What is unique for each APK?

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).


2 Answers

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.

like image 69
yorkw Avatar answered Sep 18 '22 19:09

yorkw


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.

enter image description here

like image 45
davehale23 Avatar answered Sep 21 '22 19:09

davehale23