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

防止应用程序在Android平板电脑上运行,第1张

概述我的项目支持单个apk用于手机和10英寸平板电脑.然而,手机和平板电脑的UI非常不同.我将在下周发布该应用程序,我希望该应用程序暂时仅供手机用户使用.由于测试未完成,平板电脑版本将被暂停.清单中的以下声明是否会阻止在10英寸平板电脑上安装/显示应用程序<manifest...><s

我的项目支持单个apk用于手机和10英寸平板电脑.然而,手机和平板电脑的UI非常不同.我将在下周发布该应用程序,我希望该应用程序暂时仅供手机用户使用.由于测试未完成,平板电脑版本将被暂停.
清单中的以下声明是否会阻止在10英寸平板电脑上安装/显示应用程序

<manifest ... >    <supports-screens androID:smallScreens="true"                      androID:normalScreens="true"                      androID:largeScreens="true"                      androID:xlargeScreens="false"/>    ...    <application ... >        ...    </application></manifest>

对此的解决方案应该是:这将从10英寸(xLarge)平板电脑中过滤掉应用程序?

<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" />    <!-- all large size screens -->    <screen androID:screenSize="large" androID:screenDensity="ldpi" />    <screen androID:screenSize="large" androID:screenDensity="mdpi" />    <screen androID:screenSize="large" androID:screenDensity="hdpi" />    <screen androID:screenSize="large" androID:screenDensity="xhdpi" /></compatible-screens>...<application ... >    ...<application>

解决方法:

Will the below declaration in manifest prevent applications from being installed/visible on 10 inch tablets

不.使用该清单条目,您告诉AndroID允许您的应用程序使用-xlarge设备,AndroID会做一些额外的工作来尝试让您的UI拉伸以填满屏幕.

要阻止安装(并从Play商店列表中过滤掉),请执行you will need to use <compatible-screens>.

总结

以上是内存溢出为你收集整理的防止应用程序在Android平板电脑上运行全部内容,希望文章能够帮你解决防止应用程序在Android平板电脑上运行所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1114348.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存