安卓:禁用应用程序的平板电脑 [英] Android: Disable application for tablet

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

问题描述

我开发的应用程序,现在我要限制的应用程序的平板电脑。

I developed an application, Now i want to restrict the application for tablet.

意味着应用程序不应该在任何平板电脑上运行。对于我指定的支持,屏幕的Andr​​oidmenifest.XML文件:

Means the application should not run on any tablets. For that I specify the support-screens in Androidmenifest.XML file as:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.abc.xyz"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="5"
    android:targetSdkVersion="17"
    android:maxSdkVersion="17" />

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

<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<application
    android:icon="@drawable/appicon"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Black.NoTitleBar"
    android:allowBackup="true" >

    <activity
        android:name="com.abc.xyz.activities.hello"
        android:label="@string/title_activity_hello" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>        
</application>

</manifest>

现在的问题是:

应用程序在平板电脑上运行

 android:largeScreens="false"
 android:xlargeScreens="false"

宣布上述过之后。

现在我应该怎么做。请建议我,引导我。

Now what should i do. Please suggest me and guide me.

推荐答案

包含在你的Menifest如下:

Include following in your Menifest :

<manifest ... >
<compatible-screens>
    <!-- all small size screens -->
    <screen android:screenSize="small" android:screenDensity="ldpi" />
    <screen android:screenSize="small" android:screenDensity="mdpi" />
    <screen android:screenSize="small" android:screenDensity="hdpi" />
    <screen android:screenSize="small" android:screenDensity="xhdpi" />
    <!-- all normal size screens -->
    <screen android:screenSize="normal" android:screenDensity="ldpi" />
    <screen android:screenSize="normal" android:screenDensity="mdpi" />
    <screen android:screenSize="normal" android:screenDensity="hdpi" />
    <screen android:screenSize="normal" android:screenDensity="xhdpi" />
</compatible-screens>
</manifest>

这会帮助你。

这篇关于安卓:禁用应用程序的平板电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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