Skip to main content

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.

val fusedLocation:FusedLocation = FusedLocation(context)
fusedLocation.initialize()

2. Add Listener

Call the registerFusedLocationCallback API to register the FusedLocation callback.

fusedLocation.registerFusedLocationCallback(listener: 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.

fusedLocation.unregisterFusedLocationCallback(listener: ai.pleos.playground.location.fused.listener.FusedLocationListener)

4. Release SDK

Call the release API to free the resources of the Fused Location SDK.

fusedLocation.release()