Android 清单仅限于平板电脑 [英] Android Manifest Restrict To Tablets

查看:35
本文介绍了Android 清单仅限于平板电脑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于商业原因,我想将我的 Android 应用程序严格限制在平板设备上.

For business reasons I'd like to restrict my Android application strictly to tablet devices.

目前,我可以通过设置将应用限制为蜂窝设备:

At the moment, I can limit the app to Honeycomb devices by setting:

android:minSdkVersion="11"

但下一版本的 Android(冰淇淋三明治)将有更高的版本号,适用于平板电脑和手机版本的操作系统.

But the next version of Android (Ice Cream Sandwich) will have a higher version number for both the tablet and phone versions of the OS.

我可以指定任何清单属性来将其限制为平板设备吗?(Honeycomb 或任何更新的平板电脑版本)

Is there any manifest attribute I can specify to restrict it to tablet devices? (Honeycomb or any later tablet version)

推荐答案

你会发现这个链接很棒:http://android-developers.blogspot.com/2011/09/preparing-for-handsets.html

You will find this link awesome: http://android-developers.blogspot.com/2011/09/preparing-for-handsets.html

我们所说的平板电脑"的问题在于每个人的定义都不一样.我想到了与手机大小相同但标有平板电脑"名称的 Archos 5IT.Dell Streak 也有同样的问题.

The problem with what we call "tablet" is that the definition is not the same for evryone. I think about the Archos 5IT that is the same size than a phone but branded with "tablet" name. Same issue with Dell Streak.

我个人不会称它为平板电脑..

I would personnaly not call that a tablet..

因此,如果您想限制为 7 或 5 英寸的设备,则应使用 xlargeScreens 和 largeScreens.

So if you want to restrict to 7 or 5 inches devices, you should use xlargeScreens and largeScreens.

(HTC flyer 还有一个bug——7英寸——使用大屏,怪HTC)

(There is also a bug in HTC flyer - 7 inches- that uses largeScreens, blame HTC)

我想在 Manifest 中使用 Screen size 会满足您的需求:

I guess that playing with Screen size in Manifest will fit your needs:

<supports-screens android:smallScreens="false"
                  android:normalScreens="false"
                  android:largeScreens="false"
                  android:xlargeScreens="true"
                  android:anyDensity="true"
                  android:requiresSmallestWidthDp="600"
                  android:compatibleWidthLimitDp="integer"
                  android:largestWidthLimitDp="integer"/>

这篇关于Android 清单仅限于平板电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆