Get Location Events

Apps can personalize the experience with accurate geo-context and location events.

The SDK gets a location fix as soon as initialized and starts to save position history on the device as well in the cloud. The SDK provides real-time callbacks when the phone departs an area, arrives in an area, or stays within an area. You can also get callbacks when the phone moves a significant distance or stays in the same place for longer periods of time.

Each location event is accompanied by a string indicating the type of event recorded. There is no need for you to persist any data in your app, the SDK will do it all for you.

Event

Description

arrival

triggered when user arrives at a location

stay

triggered when user stays at the same location

departure

triggered when user leaves a location

move

triggered when user moves a significant distance

ping

periodic ping to get location and generate deeper insights

sys

generated by the SDK to monitor init & transition events

tag

generated by you, the user of our SDK

To register for and receive the location events, use the below code snippet:

mMomentsClient.monitorLocation("anything", new LocationCallback<String>() {
@Override
public void handleLocation(String extra, Location loc) {
Bundle bundle = loc.getExtras();
String action = bundle.getString(Moments.KEY_TRAIL_ACTION);
if(Moments.TRAIL_ACTION_DEPARTURE.equals(action)){
bundle.getLong(Moments.KEY_ARRIVAL_TIME);
}
// Do something
}
});

Questions?

We are eager to hear from you and happy to share best practices for integrating the SDK. There are many ways for you to reach us:

But first, please sign up for an account with LOTaDATA so that we may send you the link to download our SDK.