正确的方法只在清单中声明手机

时间:2016-08-09 08:50:49

标签: android android-studio android-manifest

在搜索关于此主题的堆栈溢出的许多旧答案并且没有找到明确的更新答案后,我仍然有点困惑!我的minSdk是14,我想只为手机制作我的应用程序但是如果我这样做

<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>

像galaxy s4 s5 s6和s6 edge这样的手机呢!他们不会属于大类吗?如果是这样的话,如果没有开放对平板电脑的支持,会如何宣布?

2 个答案:

答案 0 :(得分:1)

试试这个

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

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

我从https://developer.android.com/guide/practices/screens_support.html获得支持的android密度值(支持的屏幕范围)

但我不确定它是否适用于Sony Xperia Z5 Premium,因为其密度为801dp(http://dpi.lv/#3840×2160@5.5“)

答案 1 :(得分:0)

我在我的代码中使用了以下内容,它在Google Play中运行良好。

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