gpt4 book ai didi

android - 禁用特定版本,例如 Honeycomb/3.1

转载 作者:太空宇宙 更新时间:2023-11-03 10:25:36 24 4
gpt4 key购买 nike

有没有办法从 Google Play 中禁用特定版本。例如从 Google Play 隐藏/禁用 Honeycomb 3.1 版?

目前我有

<supports-screens 
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>

<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="10"/>

但我不希望 3.1 版的用户看到我的应用。

谢谢!

最佳答案

在 google play 中你可以上传多个 apk,这样你就可以有不同的版本来针对不同的平台(也许你有一个具有更新的 sdk 功能的版本,但你保留了另一个为具有不同功能的旧手机构建的版本)。 . 你可以有两个,代码相同:一个目标低于 3.x,另一个目标高于 3.x……当然,你必须维护两个具有相同代码的 apk。此外,我认为这不会阻止他们进行侧载,它只是将其从 Play 商店应用的结果中过滤掉。

假设您只想阻止 3.1,而您支持从 1.5+ 到 4.1对于一个 apk,您将拥有:

<uses-sdk android:minSdkVersion="3" 
android:targetSdkVersion="16"
android:maxSdkVersion="10" />

另一个:

<uses-sdk android:minSdkVersion="12" 
android:targetSdkVersion="16"
android:maxSdkVersion="16" />

当然,根据需要调整目标和范围。如果 max < target 可能会脾气暴躁,我不确定。并记住目标 sdk 兼容性..

作为后续,这里有一些关于多个 apk 的文档的见解:

API level This is based on your manifest file's element. You can use both the android:minSdkVersion and android:maxSdkVersion attributes to specify support for different API levels. For example, you can publish your application with one APK that supports API levels 4 - 7 (Android 1.6 - 2.1)—using only APIs available since API level 4 or lower—and another APK that supports API levels 8 and above (Android 2.2+)—using APIs available since API level 8 or lower. Note: If you use this characteristic as the factor to distinguish multiple APKs, then the APK with a higher android:minSdkVersion value must have a higher android:versionCode value. This is also true if two APKs overlap their device support based on a different supported filter. This ensures that when a device receives a system update, Google Play can offer the user an update for your application (because updates are based on an increase in the app version code). This requirement is described further in the section below about Rules for multiple APKs. You should avoid using android:maxSdkVersion in general, because as long as you've properly developed your application with public APIs, it is always compatible with future versions of Android. If you want to publish a different APK for higher API levels, you still do not need to specify the maximum version, because if the android:minSdkVersion is "4" in one APK and "8" in another, devices that support API level 8 or higher will always receive the second APK (because it's version code is higher, as per the previous note).

http://developer.android.com/guide/google/play/publishing/multiple-apks.html

关于android - 禁用特定版本,例如 Honeycomb/3.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13161270/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com