我的项目支持单个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>
.