HUAWEI Location Kit Scenario Description

Search This thread

XDARoni

XDA Community Manager
1. Development Scenario

  • Location update
    If your app needs to request the device location continuously, you can apply for the location permission for your app, call the requestLocationUpdates() API of Location Kit, set different request parameters (in LocationRequest), and specify a location mode as needed. To cancel location information callback, call the removeLocationUpdates() API.
  • Location semantics
    If your app needs to obtain both the location information and its address information, you can set isNeedAddress in LocationRequest to true, specify a language and country code, and then call the requestLocationUpdates() API.
  • Activity identification
    If your app needs to obtain the activity status of the user's device (for example, walking, running, or bicycling) or your app needs to detect activity status change of a user, you can apply for the activity identification permission for your app and call the createActivityIdentificationUpdates() API. To cancel activity identification update, call the deleteActivityIdentificationUpdates() API. If you want to detect user activity status change, call the createActivityConversionUpdates() API to listen on activity status changes of the current device. To cancel listening on activity status changes, call the deleteActivityConversionUpdates() API.
  • Geofence
    If you are interested in a place, you can call the createGeofenceList() API to create a geofence based on the place. Then, Location Kit can sense the distance between the current device location and the geofence. When the device enters the geofence, a notification will be sent to your app. In addition, Location Kit can detect the duration during which the device stays in the geofence, and send a notification to your app if the duration reaches a specified value.

2. Development Process
The following figure shows the overall development process. The detailed development procedures are described in the following sections. If you have an app with third-party mobile services integrated, you can use HMS Convertor to automatically convert APIs of the third-party mobile services into HMS-based APIs, achieving quick integration of HMS services. To learn more about HMS Convertor, click here.
7FP2yqp.png