簡體   English   中英

如何在Android中支持所有設備(移動設備和平板電腦)?

[英]How to support all devices( Both mobile and Tablets) in android?

我的應用程序適用於所有設備(移動設備和平板電腦)。 但是Play商店發布不支持某些設備。 我也包括清單文件。

我做錯了什么?

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

    <screen android:screenSize="xlarge" android:screenDensity="ldpi" />
    <screen android:screenSize="xlarge" android:screenDensity="mdpi" />
    <screen android:screenSize="xlarge" android:screenDensity="hdpi" />
    <screen android:screenSize="xlarge" android:screenDensity="xhdpi" />
</compatible-screens>

您可以在清單文件中使用以下代碼

<supports-screens
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="false" />

一個錯誤是您擁有<compatible-screens> 如果要支持所有屏幕尺寸和密度,請刪除<compatible-screens>元素。 就目前而言,您缺少一些密度。

另請注意,“所有設備”與您的<supports-screens>元素背道而馳,您說的是,一側的最小尺寸為240dp。 但是,至少在我上次檢查時,至少根據文檔,它並未用於Play商店過濾。

還請確保是否使用了諸如電話等功能,並且在androidmanifest.xml中配置了uses-feature選項。

例如

<uses-feature android:name="android.hardware.telephony" android:required="false"/>

其中有很多用於藍牙wifi等功能,因此,如果任何設備不具備這些功能,但是您仍然希望在其上安裝應用程序,則需要設置“ required”標志。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM