是否可以根据国家/地区提供多个 APK 支持?
我有一个包含免费和收费产品的应用程序,我需要为我的应用程序创建两个 APK,并在支持应用内结算的国家/地区显示支持应用内结算的应用程序,并显示不支持应用内结算的同一应用程序的另一个 APK - 在不支持的国家/地区进行应用程序计费(仅提供免费产品)。
我可以使用 Android Market 多 APK 支持功能来实现此目的吗?如果没有,除了创建两个单独的应用程序之外,还有其他可行的建议吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
多个 APK 功能 AFAIK 至少在当前版本中不支持过滤国家/地区。查看支持的过滤器和多个 APK 的规则了解更多详情。
如果您无论如何都要构建两个 apk。将它们发布为两个独立的应用程序(您可以在开发人员控制台中为每个应用程序设置不同的可用国家/地区)要简单且易于维护,而不是使用多个 APK 功能(据说甚至在未来版本中支持过滤国家/地区)。人们用来避免重复代码的常用方法是使用 Android 库项目。
如果您只想为所有情况构建和发布一个 apk。一个可行的解决方案可以是在项目资源中维护受支持的国家/地区列表,并添加一些条件分支以根据国家/地区列表启用/禁用应用内计费代码,并在运行时通过一些 UI 警告来确认用户,例如:
如您所见,每次有新的国家支持或被 Google 删除时,都需要(甚至没有必要)更新/重新发布。
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:
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.
您可以通过本地化您的应用程序来实现这一点。检查此。
You can achieve this by localizing your application. Check this.