android - 如何要求 android.permission.CALL_PHONE 但仍安装在平板电脑上?

标签 android google-play

这个问题在这里已经有了答案:





Optional permissions so an app can show on all devices and enable optional features on some?

(1 个回答)


7年前关闭。




我有一个刚刚发布到 Play 商店的应用程序,当我尝试从没有电话功能的平板电脑访问它时,它显示为“此应用程序与您的所有设备不兼容”。它在实际的 Android 手机上安装得很好。

事情是这样的——我们希望用户能够在平板电脑和其他没有电话的设备上安装应用程序,并且让电话功能无法正常工作。但如果我在 list 中包含 CALL_PHONE 权限,Play Store 根本不允许安装它。

<uses-permission android:name="android.permission.CALL_PHONE" />

如何让 Google Play 允许要求 CALL_PHONE 权限的应用安装在没有手机的设备上?

最佳答案

您可以指定 Telephony 是可选的:

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

documentation说:

The table below lists permissions that imply feature requirements equivalent to those declared in elements. Note that declarations, including any declared android:required attribute, always take precedence over features implied by the permissions below.

For any of the permissions below, you can disable filtering based on the implied feature by explicitly declaring the implied feature explicitly, in a element, with an android:required="false" attribute. For example, to disable any filtering based on the CAMERA permission, you would add this declaration to the manifest file:

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


在您的情况下,表格的相关部分是:
Cateegory   This permission...     Implies This Feature Requirement 
Telephony   CALL_PHONE             android.hardware.telephony
            CALL_PRIVILEGED        android.hardware.telephony
            MODIFY_PHONE_STATE     android.hardware.telephony
            PROCESS_OUTGOING_CALLS android.hardware.telephony
            READ_SMS               android.hardware.telephony
            RECEIVE_SMS            android.hardware.telephony
            RECEIVE_MMS            android.hardware.telephony
            RECEIVE_WAP_PUSH       android.hardware.telephony
            SEND_SMS               android.hardware.telephony
            WRITE_APN_SETTINGS     android.hardware.telephony
            WRITE_SMS              android.hardware.telephony

关于android - 如何要求 android.permission.CALL_PHONE 但仍安装在平板电脑上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29851303/

相关文章:

java - 在 ArrayList 中使用泛型(Java, "cannot be applied"错误)

android - @react-native-firebase/admob 的基本用法给出 : "TypeError: (0, _admob.default) is not a function". 是否已弃用?或为什么不起作用?

android - 什么是工具 :layout in fragment xml file?

android - LibGDX 和 Google Play 游戏不工作

android - Ctrl + Space 无法正常工作 Android Studio

android - 如何从我的应用程序打开 Google Play 商店应用程序以安装 Play 商店中可用的最新版本的应用程序

android - 如何在满足特定条件时结束android订阅?

android - 我想将我的应用程序目标 sdk 版本 29 降级到 28,Google Play 控制台是否允许这样做?

android - 'Start rollout to production' 按钮在 'Timed Publishing' 中会做什么

java - Fabric/Crashlytics NoClassDefFoundError 仅在某些设备上