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

前端 未结 1 1382
有刺的猬
有刺的猬 2020-11-29 05:25

Many features in Android require a uses-permission to be set in the manifest. These values then determine what devices will see them in the Market. However, what should be d

相关标签:
1条回答
  • 2020-11-29 05:49

    What is a general solution for this problem?

    For that specific problem, add <uses-feature android:name="android.hardware.telephony" android:required="false"/> to your manifest, to indicate that this feature is optional. You can then use PackageManager and hasSystemFeature() to determine if a device has the non-required feature at runtime.

    0 讨论(0)
提交回复
热议问题