2

I have developed a Referee Watch (https://play.google.com/store/apps/details?id=com.pipperpublishing.soccerrefpro) which tracks referees field coverage and other fitness stats using the watch GPS. This is NOT a question about ACCESS_FINE_LOCATION permissions which I am handling just fine.

I understand I can use getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION_GPSto determine if the Watch has GPS. However, if a user accidentally turns OFF Settings>Location on the Watch, is there a way of detecting it? I suspect the watch will report TRUE for the above call, but then attempt to deliver location using the Fused Location Provider from the phone wifi/gps/cell. That of course is useless once you are running on the field with the phone in the bag.

I have tried looking at the Fitness Sensor sources and determining whether the source is Local or not, but that doesn't seem to work.

Opus1217
  • 723
  • 4
  • 17

1 Answers1

0

If you've already determined whether your Android Wear device has a built-in GPS sensor using the hasSystemFeature() method, then you can proceed with handling disconnection events.

You may want to implement onPeerDisconnected() method so that your app should be able to handle loss of location data in case the wear device loses connection with its paired device.

Also, check this SO post for additonal insights on how to trigger a system UI to get that permission to enable location dialog.

Teyam
  • 7,686
  • 3
  • 15
  • 22