如何限制 android 应用仅在接受 SIM 卡的设备上可用?
How do I restrict an android app to be available on only devices that accept a sim card?
我正在开发一款应用,该应用使用的功能只有在设备可以接收短信时才可用。如何确保该应用程序仅与 sim 卡可接受的设备兼容?
您应该在 AndroidManifest.xml
中使用标志
以这种方式将 uses-feature 行添加到您的清单中:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.app">
<!-- Add this line to your manifest -->
<uses-feature android:name="android.hardware.telephony" android:required="true" />
<!-- other declarations -->
[....]
</manifest>
这样 Google Play 商店不应为没有 SIM 卡或无线电通信的设备列出您的应用。
您可以在 AndroidManifest.xml
中使用 uses-feature 标志
<uses-feature android:name="android.hardware.telephony" android:required="true" />
通过使用它,它将为您过滤 simless 设备。
https://developer.android.com/guide/topics/manifest/uses-feature-element.html
我正在开发一款应用,该应用使用的功能只有在设备可以接收短信时才可用。如何确保该应用程序仅与 sim 卡可接受的设备兼容?
您应该在 AndroidManifest.xml
以这种方式将 uses-feature 行添加到您的清单中:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.app">
<!-- Add this line to your manifest -->
<uses-feature android:name="android.hardware.telephony" android:required="true" />
<!-- other declarations -->
[....]
</manifest>
这样 Google Play 商店不应为没有 SIM 卡或无线电通信的设备列出您的应用。
您可以在 AndroidManifest.xml
中使用 uses-feature 标志<uses-feature android:name="android.hardware.telephony" android:required="true" />
通过使用它,它将为您过滤 simless 设备。 https://developer.android.com/guide/topics/manifest/uses-feature-element.html