gpt4 book ai didi

android - 将 Android 应用程序限制为仅限手机问题

转载 作者:行者123 更新时间:2023-11-29 01:21:15 25 4
gpt4 key购买 nike

浏览这里的其他帖子和 android 文档,我添加了 <compatible-screens>到我的 android list 文件以将我的应用程序限制为仅用于手机。但是,每当我尝试在 Nexus 7 平板电脑上运行它时,该应用程序都会出现在平板电脑上。下面是我的 android list 文件。我错过了什么吗?

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp.testapplication" >

<uses-permission android:name="android.permission.READ_CONTACTS" />
<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>

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

最佳答案

However whenever I try running it on the Nexus 7 tablet, the app shows up on tablet

当然。如果您在设备上手动运行该应用程序,它将运行。

引用 the documentation :

The Android system does not read the <compatible-screens> manifest element (neither at install-time nor at runtime). This element is informational only and may be used by external services (such as Google Play) to better understand the application's compatibility with specific screen configurations and enable filtering for users.

关于android - 将 Android 应用程序限制为仅限手机问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36671237/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com