我创建了新的应用程序,不适用于手机。我的应用程序基于 7 英寸平板设备。
当我尝试将我的应用程序放入 Play 商店时,它显示我的应用程序支持 2000 种 Android 设备,但并非所有设备都是平板电脑。事实上,我不想用谷歌搜索所有设备并设置过滤器,你知道为什么!
如何以编程方式在我的应用程序中声明最小屏幕尺寸,就像我可以设置最小 sdk 级别一样。
Update:
我是在AndroidManifest.xml中设置的<compatible-screens>
and <supports-screens>
像那样:
<supports-screens android:requiresSmallestWidthDp="600"
android:smallScreens="false"
android:normalScreens="false"
android:largeScreens="false"
android:xlargeScreens="true"
/>
<compatible-screens>
<screen android:screenSize="xlarge" android:screenDensity="xhdpi"/>
<screen android:screenSize="xlarge" android:screenDensity="ldpi"/>
<screen android:screenSize="xlarge" android:screenDensity="hdpi"/>
<screen android:screenSize="xlarge" android:screenDensity="mdpi"/>
</compatible-screens>
现在我的应用程序仅适用于 7 英寸以上的平板电脑。
你需要使用<supports-screens>
正如 DJHacktorReborn 所建议的,但不仅仅是android:requiresSmallestWidthDp
,因为 Play 商店不使用它进行过滤。
相反,使用:
<manifest ... >
<supports-screens android:smallScreens="false"
android:normalScreens="false"
android:largeScreens="true"
android:xlargeScreens="true"
android:requiresSmallestWidthDp="600" />
...
<application ... >
...
</application>
</manifest>
See 文档 http://developer.android.com/guide/practices/screens-distribution.html#FilteringTabletApps了解更多。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)