3

我的项目支持手机和 10 英寸平板电脑的单个 apk。然而,手机和平板电脑的用户界面非常不同。我将在下周发布该应用程序,并且我希望该应用程序暂时仅可供电话用户使用。由于测试未完成,平板电脑版本被搁置。清单中的以下声明是否会阻止应用程序在 10 英寸平板电脑上安装/可见

<manifest ... >
    <supports-screens android:smallScreens="true"
                      android:normalScreens="true"
                      android:largeScreens="true"
                      android:xlargeScreens="false"/>
    ...
    <application ... >
        ...
    </application>
</manifest>

解决方案应该是:这会从 10 英寸(xLarge)平板电脑中过滤掉应用程序吗?

<manifest ... >
<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" />
    <!-- all large size screens -->
    <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" />
</compatible-screens>
...
<application ... >
    ...
<application>

4

1 回答 1

8

清单中的以下声明是否会阻止应用程序在 10 英寸平板电脑上安装/可见

No. With that manifest entry, you are telling Android to allow your app on -xlarge devices, with Android doing some extra work to try to make your UI stretch to fill the screen.

To block installation (and be filtered out of the Play Store listings), you will need to use <compatible-screens>.

于 2012-07-27T15:33:34.333 回答