gpt4 book ai didi

android - 平板电脑设计的谷歌开发者控制台优化技巧(minSdkVersion)

转载 作者:行者123 更新时间:2023-11-29 18:00:14 27 4
gpt4 key购买 nike

在下面找到谷歌在其最新的谷歌 IO-13 计划中优化应用程序平板电脑的说法。我的问题是:- 为什么我的应用程序必须具有大于 11 的最小 sdk 版本才能使其针对平板电脑进行优化?这意味着如果我支持在许多设备中仍然有效的 Gingerbread 手机,我的应用程序不适用于平板电脑。

At a minimum, check the element to make sure that:

targetSdkVersion is declared with value 11 or higher (14 or higher is recommended), OR
minSdkVersion is declared with value 11 or higher.
If a maxSdkVersion attribute is declared, it must have a value of 11 or higher. Note that, in general, the use of maxSdkVersion is not recommended.

最佳答案

来自 <uses-sdk> documentation :

[...] setting [the targetSdkVersion] value to "11" or higher allows the system to apply a new default theme (Holo) to your app when running on Android 3.0 or higher and also disables screen compatibility mode when running on larger screens (because support for API level 11 implicitly supports larger screens).

这里有一些关键的事情需要注意。

  • 您不需要将 minSdkVersion 设置为 11。他们建议将 minSdkVersion 或 targetSdkVersion 设置为 为 11。对平板电脑而言,两者都具有相同的效果。
  • 即使不这样做,您也可以让应用程序在平板电脑上正常运行。它只会使用屏幕兼容模式,这不是最佳选择。
  • 如果您不针对更高的 API 版本(或使用 minSdkVersion 隐式这样做),那么您的应用也不会使用 Holo(没有库),这是对较新 (3.0+) 应用的标准 UI 期望设备。

关于android - 平板电脑设计的谷歌开发者控制台优化技巧(minSdkVersion),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16589482/

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