限制仅在移动设备上安装的应用程序并排除平板电脑

时间:2017-12-06 11:32:39

标签: android mobile

我正在创建一个只需要安装在移动设备上的应用程序,并且应该排除所有平板电脑。已经有很多相同的问题,但当时xxxhdpi分辨率设备没有像Pixel 2和三星Galaxy S8 plus那样推出大屏幕。那么如何限制仅在移动设备上安装的应用程序呢?

我尝试了下面的代码,但它没有帮助。

openValueHelpDialog: function(oEvent) {
    var oDialog = sap.ui.xmlfragment();
    var oField = new sap.ui.core.CustomData();
    oField.setKey("field");
    oField.setValue(oEvent.getParameter("id"));
    oDialog.addCustomData(oField);
    oDialog.open();
}`

1 个答案:

答案 0 :(得分:1)

任何遇到相同问题的人都可以尝试以下代码。

<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" />
    <screen android:screenSize="small" android:screenDensity="xxhdpi" />
    <screen android:screenSize="small" android:screenDensity="xxxhdpi" />
    <!-- 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" />
    <screen android:screenSize="normal" android:screenDensity="xxhdpi" />
    <screen android:screenSize="normal" android:screenDensity="xxxhdpi" />


    <screen android:screenSize="normal" android:screenDensity="420" />
    <screen android:screenSize="normal" android:screenDensity="480" />
    <screen android:screenSize="normal" android:screenDensity="560" />
    <screen android:screenSize="normal" android:screenDensity="640" />

    <screen android:screenSize="large" android:screenDensity="420" />
    <screen android:screenSize="large" android:screenDensity="480" />
    <screen android:screenSize="large" android:screenDensity="560" />
    <screen android:screenSize="large" android:screenDensity="640" />
</compatible-screens>

屏幕密度640是手机设备的最高密度。我已经在Playstore上查看了它,它将排除所有平板电脑,并将包含所有设备。