android - 阻止应用程序在安卓平板电脑上运行

标签 android manifest tablet google-play

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

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

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

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

最佳答案

Will the below declaration in manifest prevent applications from being installed/visible on 10 inch tablets

没有。通过该 list 条目,您告诉 Android 允许您的应用程序在 -xlarge 上运行设备,而 Android 会做一些额外的工作来尝试让您的 UI 拉伸(stretch)以填满屏幕。

要阻止安装(并从 Play 商店列表中过滤掉),you will need to use <compatible-screens> .

关于android - 阻止应用程序在安卓平板电脑上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11690774/

相关文章:

android - 无法推送选择 : Read-only file system - androrid sdcard

android - 如何在jetpack compose中删除文本基线下方的空格?

java - eclipse "Sorry- The application (Appname) has stopped unexpectedly. Please try again"

javascript - '安卓 :name' in <activity> tag must be a valid Java class name in React Native

java - 让 Android+Gradle+Jenkins+Spoon 协同工作

android - Android 中基于 UDT 的 HTTP

android - PWA Android/chrome 启动画面上显示的错误图标

CSS媒体屏幕

Android Market 通用应用程序(平板电脑 + 手机)

Android:多 Pane 布局上操作栏/选项菜单的设计模式