> For the complete documentation index, see [llms.txt](https://docs.mapbox.com/android/ja/navigation/ux/llms.txt)

# Custom location provider

In some cases, you might need to use your own source of location updates. For example, automotive OEMs may want to implement gathering GPS signals from an alternative hardware. In that case, you can build your custom location provider which must implement the [`LocationProvider`](https://docs.mapbox.com/android/navigation/api/uxframework/1.28.0/dash-config/com.mapbox.dash.sdk.config.api/-location-provider/) interface, and then wrap it in a factory. In the code, it may look like this:

```kotlin
Dash.init(
   applicationContext = applicationContext,
   accessToken = getString(R.string.mapbox_access_token)
) {
    customLocationProviderFactoryConfig = CustomLocationFactoryProviderConfig.Builder(
        LocationProviderFactory { _ ->
            MyLocationProvider()
        },
        // The locations emitted by MyLocationProvider are real, so specify type REAL. 
        // If custom location provider is mocked or mixed, make sure it sets the correct isMock flag to mocked locations.
        LocationProviderType.REAL,
    ).build()
}
```

Where `MyLocationProvider` is the implementation of `LocationProvider`.