> For the complete documentation index, see [llms.txt](https://docs.ep.mburger.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ep.mburger.cloud/android-docs/audience/untitled.md).

# Location Data

MBAudience let you track and target user based on their location, the framework uses a foreground `FusedLocationProviderClient` with priority `PRIORITY_BALANCED_POWER_ACCURACY` which **is killed** the moment the app goes in background:

```
MBAudience.startLocationUpdates(context: Context)
```

To stop monitoring location changes you have to call:

```
MBAudience.stopLocationUpdates()
```

If you wish to track user position while app is in background you need to **implement your own location service**, then when you have a new location you can use this API to send it to the framework:

```
MBAudience.setPosition(context: Context, latitude: Double, longitude: Double)
```
