GPS Manifest: GPS in App is optional, want to make it available to GPS less devices too

后端 未结 1 567
梦谈多话
梦谈多话 2020-12-09 08:02

On uploading my App onto the market today, I saw that it is only available to devices with GPS, so this excludes some tablets.

GPS in my App is optional. Is it possi

相关标签:
1条回答
  • 2020-12-09 09:02

    Add the following to your manifest

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

    This will tell Google Play that while your app has the GPS, it's absolute requirement isn't true. However, you should handle the lack of GPS in your app gracefully, instead of letting it crash.

    To check is the device has GPS you can call LocationManager.getAllProviders() and check whether LocationManager.GPS_PROVIDER is included in the list.

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