ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

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

2019-07-25 23:24:28  阅读:247  来源: 互联网

标签:android google-play manifest tablet


我的项目支持单个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,google-play,manifest,tablet
来源: https://codeday.me/bug/20190725/1538007.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有