0

We are building an application that runs on Automotive OS in cars. Trying to build a geofence which the car exits, we want to do something.
I notice that fence is created only when 'Improve Location Accuracy' in settings is enabled. If it is disabled after fence is created, then exit transition event is not received in receiver.
Looks like Android does not do anything(create of trigger event) about fence unless it feels the location is accurate.

Do any of you have an experience about it ?
Is enabling 'Improve Location Accuracy' mandatory in order for fence to be create ?

Doc does not say anything about it unfortunately. Any inputs will be great.

oguz ismail
  • 1
  • 16
  • 47
  • 69
cgr
  • 4,578
  • 2
  • 28
  • 52

1 Answers1

0

The Android geofencing documentation clearly says:

To use geofencing, your app must request the following:

  • ACCESS_FINE_LOCATION

  • ACCESS_BACKGROUND_LOCATION if your app targets Android 10 (API level 29) or higher

That first permission is the "Accurate Location" permission. ‍♂️

frezq
  • 653
  • 8
  • 18
  • THat is true. But what I asked in the question is about 'Improve Location Accuracy' in settings. I noticed only when this setting is enabled, my app could create fence. @frezq – cgr Jun 13 '22 at 08:35
  • I guess if for geofencing to work, it requires the "permissions of retrieving accurate locations", then needing the "accurate locations feature" itself to be enabled makes sense – frezq Jun 14 '22 at 08:59
  • 1
    Thanks for taking time to comment. Yes and to have smooth flow for user to enable that, app should have one more dialog with button click on that redirects to settings to enable "accurate locations feature". But that happens only if user wants to. This means one flow to enable background loc permission and another flow for this. We already have loc permission enable flow. – cgr Jun 15 '22 at 14:56