如何限制应用程序只Android手机应用程序、手机、Android

2023-09-06 15:58:57 作者:我爱你是你的口头禅

您好,我针对用户安卓只手机。我想限制应用程序安装在安卓手机ONY不phablets和平板电脑。

Hello I am targeting users to Android phones only. I want to restrict the app to install on Android phones ony not on phablets and tablets.

什么配置,我需要在AndroidManifest.xml中应用,使谷歌Play应用不会显示在表中,phablets的应用程序。

What are the configuration do I need to apply in AndroidManifest.xml so that Google Play app wont show the app in the table and phablets.

在此先感谢。

推荐答案

引用的文档:

由于该系统一般扩展应用程序很好地适应更大的屏幕,你不应该需要从更大的屏幕过滤应用程序。只要您按照最佳实践屏独立,你应用程序应该在更大屏幕上正常工作,如平板电脑。但是,你可能会发现你的应用程序不能按比例增长,或也许你已经决定要发布应用程序的不同屏幕配置两个版本。在这种情况下,您可以使用 <兼容屏> 来管理你的应用程序根据屏幕大小和密度的组合分布元素。外部服务,如谷歌播放使用这些信息来过滤应用到应用程序,从而使具有屏幕配置与声明只兼容设备可以下载应用程序。

Because the system generally scales applications to fit larger screens well, you shouldn't need to filter your application from larger screens. As long as you follow the Best Practices for Screen Independence, your application should work well on larger screens such as tablets. However, you might discover that your application can't scale up well or perhaps you've decided to publish two versions of your application for different screen configurations. In such a case, you can use the <compatible-screens> element to manage the distribution of your application based on combinations of screen size and density. External services such as Google Play use this information to apply filtering to your application, so that only devices that have a screen configuration with which you declare compatibility can download your application.

记住,&LT;兼容屏&GT; 要求你白名单每一个屏幕大小的和密度的,你是支持(我们得到每一年左右新的密度),并且你是有限的经典屏幕尺寸桶(正常 XLARGE )。该文件的样本缺少一些密度:

Bear in mind that <compatible-screens> requires you to whitelist every screen size and density that you are supporting (and we get a new density every year or so), and you are limited to the classic screen size buckets (small, normal, large, xlarge). The documentation's sample is missing some densities:

<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" />
</compatible-screens>

您将需要添加额外的元素,如果愿意支持 tvdpi xxhdpi xxxhdpi 设备。

You will need to add additional elements if are willing to support tvdpi, xxhdpi, and xxxhdpi devices.

引述的文档&LT;兼容屏&GT;

注意:通常情况下,你不应该使用这个清单元素。使用这个元素可以极大地降低潜在用户群的应用程序,通过不允许用户安装应用程序,如果他们有,你有没有列出的屏幕配置的设备。你应该使用它只能作为最后的手段,当应用程序绝对不会与特定的屏幕配置工作。而不是使用这个元素,应该遵循的指导,支持多画面提供使用替代布局和位图不同的屏幕大小和密度的多屏幕扩展性的支持。

Caution: Normally, you should not use this manifest element. Using this element can dramatically reduce the potential user base for your application, by not allowing users to install your application if they have a device with a screen configuration that you have not listed. You should use it only as a last resort, when the application absolutely does not work with specific screen configurations. Instead of using this element, you should follow the guide to Supporting Multiple Screens to provide scalable support for multiple screens using alternative layouts and bitmaps for different screen sizes and densities.

和牢记的营销术语,如平板手机是不明确的,所以你的应用程序可能最终发货的,你忽然想到一些设备是平板手机,或者别人认为是一个平板手机。

And bear in mind that marketing terms like "phablet" is ill-defined, and so your app may wind up shipping on some devices that you happen to think is a phablet or that somebody else thinks is a phablet.