我开发了一个应用程序,现在我想限制平板电脑上的应用程序。
意味着应用程序不应在任何平板电脑上运行。为此,我在 Androidmenifest.XML 文件中将支持屏幕指定为:
<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"
上面声明之后也是如此。
现在我该怎么办。请建议我并指导我。
这会阻止平板电脑上的访问,但允许新的密度桶(xxhdpi and xxxhdpi)并避免针对较低 SDK 编译的项目出现错误。它应该是的直接子代<manifest>
元素在AndroidManifest.xml
<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" />
<screen android:screenSize="small" android:screenDensity="480" />
<screen android:screenSize="small" android:screenDensity="640" />
<!-- 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" />
<screen android:screenSize="normal" android:screenDensity="480" />
<screen android:screenSize="normal" android:screenDensity="560" />
<screen android:screenSize="normal" android:screenDensity="640" />
</compatible-screens>
更新 8.8.2016如果您想支持 420 密度的类似 Nexus-5x 的设备,请添加此行
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)