Make the first API call
How to use the Fused Location API
The Fused Location API can be used as follows.
Please check the example code.
Order of API calls
1. Initialize SDK
Call the initialize API to initialize the Fused Location SDK when starting it.
- Kotlin
- Java
val fusedLocation:FusedLocation = FusedLocation(context)
fusedLocation.initialize()
FusedLocation fusedLocation = new FusedLocation(context);
fusedLocation.initialize();
2. Add Listener
Call the registerFusedLocationCallback API to register the FusedLocation callback.
- Kotlin
- Java
fusedLocation.registerFusedLocationCallback(listener: ai.pleos.playground.location.fused.listener.FusedLocationListener)
fusedLocation.registerFusedLocationCallback(new ai.pleos.playground.location.fused.listener.FusedLocationListener());
3. Remove Listener
Before exiting the app, release the previously registered FusedLocation callback. To release the callback, call the unregisterFusedLocationCallback API.
- Kotlin
- Java
fusedLocation.unregisterFusedLocationCallback(listener: ai.pleos.playground.location.fused.listener.FusedLocationListener)
fusedLocation.unregisterFusedLocationCallback(new ai.pleos.playground.location.fused.listener.FusedLocationListener());
4. Release SDK
Call the release API to free the resources of the Fused Location SDK.
- Kotlin
- Java
fusedLocation.release()
fusedLocation.release();