排除 android 2.1 SDK 版本的 xLarge 屏幕
我创建了一个将发布到市场的应用程序。该应用程序的最低 SDK 版本是 7,而目标 SDK 是 8。但是当我上传它时,该应用程序也支持 xLarge 屏幕,导致我的应用程序崩溃。 如何在保留现有 SDK 设置的同时排除 xLarge 屏幕支持?
I created an application that will release to the market. The minimum SDK version for that application is 7 while target SDK is 8. But when I uploaded it, the application is also supporting xLarge screen and cause a crash to my app.
How can I exclude the xLarge screen support while hold up my existing SDK setting?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅 supports-screens 清单元素文档。只需将目标设置为 9 或更高,即可使用 xlarge。 任何低于 API 级别 9 的设备都不能将自己声明为 xlarge,因此仍然能够安装您的应用。这就是用户使用运行 Android 版本(< 3.0)的 Android 平板电脑所面临的缺点,而该 Android 版本在设计时并未考虑到平板电脑!我不会太担心运行 Android 版本的平板电脑用户< 3.0(蜂窝)看到您的应用程序处于不完美的状态,因为它们肯定习惯于使用此设备配置看起来不太完美的应用程序。我不知道 3.0 之前的平板电脑是否有资格获得市场支持??!
另请参阅x-large 属性设置文档表明此默认值将根据设备版本而变化,因此最好声明它。
安装应用程序的设备正在运行的较新平台版本中引入的清单中的任何内容都将被忽略。这也适用于任何 xml 布局属性。
我本以为屏幕尺寸是根据屏幕分辨率和密度计算出来的,我不确定 OEM 是否在构建时设置了它,或者是否是运行时计算。如果它是根据设备规格完成的,那就太好了,但我感觉它是一个硬编码值(我可能是错的)。不管怎样,我不认为它在清单中向后兼容(意味着它将被忽略),因为资源特定的文件夹不会。
出于兴趣,为什么不想将目标设置为高于 api 级别 8?
See the supports-screens manifest element doc. Just set your target to 9 or higher and you can use xlarge. Any device that is below api level 9 should not be able to declare itself as xlarge and therefore will still be able to install your app. Thats what the disadvantage a users gets for having an Android tablet running a version of android (< 3.0) which was not designed with tablets in mind! I wouldnt worry too much about tablet users running versions of android < 3.0 (honeycomb) seeing your app in a non-perfect state as they are most definatly used to apps looking less-than-perfect with this device config. I dont know if any tablets pre 3.0 even qualify for market support??!
Also see the x-large attribute setting doc that states the default value for this will change depending on the device version so its best to declare it.
Anything in the manifest that is introduced in a newer platform version that the device thats installing the app is running will just be ignored. This goes for any xml layout attributes too.
I wouldve thought the screen size would be worked out from screen-resolution and density, im not sure if the OEM sets this at build time or if its a runtime computation. It would be good if it was done based upon the device specs but i have a feeling its a hardcoded value (I could be wrong). Either way i dont think its backwards compatible (meaning it will just be ignored) in the manifest as resource specific folders would not be.
Out of interest, why do you not want to set your target higher than api level 8?