如何防止在Android平板电脑上安装应用程序? [英] How to prevent app installing on tablet in Android?

查看:195
本文介绍了如何防止在Android平板电脑上安装应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人告诉我要在Android 2.2中构建一个不支持平板电脑的应用程序.

我经历了很多谷歌搜索,但没有找到解决方案.我还找到了此链接,但这给出了从2.3开始执行的操作. /p>

我的问题是我无法切换到2.3,因为我的客户希望从2.2开始支持该应用.

这是我在清单中使用的代码

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

上面的代码不会阻止应用程序从平板电脑下载,因此会崩溃.

我认为,

解决方案

有点意外的答案,但是您是否尝试过完全忽略屏幕尺寸,而只是在清单中请求PHONE功能?平板电脑拥有这些功能非常罕见,因此您可以有效地过滤掉它们.例如,您可以在AndroidManifest.xml中编写:

<uses-permission android:name="android.permission.CALL_PHONE" />

I am told to build an app in Android 2.2 which will not support tablets.

I went through lots of googling but found no solution. I also found this link but this give how to do the same from 2.3 onwards.

My problem is that I can't switch to 2.3 as my client want to support the app from 2.2.

Here is the code I am using in my manifest

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

The code above doesn't prevent the app to download from tablet, and so it crashes.

解决方案

A little bit unexpected answer, I think, but have your tried to ignore screen sizes completely and just request PHONE features in the manifest? It's quite rare for a tablet to have those, so you effectively filter 'em out. For example, your may write in your AndroidManifest.xml:

<uses-permission android:name="android.permission.CALL_PHONE" />

这篇关于如何防止在Android平板电脑上安装应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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