简体   繁体   English

仅适用于手机而非平板电脑的应用程序

[英]app only for phones not tablets

I am trying to build an android app which can be downloaded only by phone not tablet.I have put this into the manifest: 我正在尝试构建一个只能通过手机而不是平板电脑才能下载的android应用程序。

<supports-screens
        android:resizeable="false"
        android:anyDensity="false"
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="false" />
    <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" />

  <uses-feature android:name="android.hardware.telephony"/>
    <uses-sdk android:minSdkVersion="14"
        android:maxSdkVersion="22"/>

Question : 问题

1.When I am running my app in the tablet emulator,it is not giving any error. 1.当我在平板电脑模拟器中运行我的应用程序时,它没有给出任何错误。 What am I doing wrong ? 我究竟做错了什么 ? Does it only work when I submit it on playstore? 仅当我在Playstore上提交它时才起作用吗? If that's so then how can I test my app before making it live ? 如果是这样,那么在发布应用程序之前我该如何测试?

2.As I have written here android:screenDensity="xhdpi" ,how to support xxhdpi ? 2. android:screenDensity="xhdpi"我在这里写的android:screenDensity="xhdpi" ,如何支持xxhdpi As an example nexus5 is xxhdpi . 例如,nexus5是xxhdpi

Note : 注意 :

By tablet I mean that the resolution isn't higher than 1440x2560 and the screen size isn't more than 6 inch and offcourse it doesn't support calling facility. 平板电脑,我的意思是分辨率不高于1440x2560 ,屏幕尺寸不超过6英寸 ,并且不支持呼叫功能。

I have also tried this and this but with no luck. 我自己也尝试这个这个 ,但没有运气。

You can't do exactly what you want. 您不能完全按照自己的意愿做。 There exists an overlapping between tablets & phones screen density. 平板电脑和手机的屏幕密度之间存在重叠。 Some tablets are of screen density as phone and vice versa. 有些平板电脑的屏幕密度与电话一样,反之亦然。 What you can do is after using some restriction from manifest remove unwanted devices from playstore. 您可以做的是使用清单中的某些限制后,从Playstore中删除不需要的设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM