Location Services

You can use Location Services to get the periodic location updates using GPS and/or network providers.

Features Requiring Location Updates

  • Distance and speed calculation for Time To Collision (TTC) alerts


To protect user privacy, applications that use location services must request location permissions. Live Sense SDK verifies this permission by checking ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION in AndroidManifest.

Configuration Modes

The accuracy of the location updates can be set by the locationManagerObject.setLocationQuality() method.

// LSDLocationManager.java
public void setLocationQuality(LSDLocationQuality locationQuality);

There are two modes to request location updates. These modes are provided in the LSDLocationQuality enum class:

  • LOW_POWER_NETWORK - uses Network and Passive providers to determine the location of device. This mode is selected by default.
  • HIGH_ACCURACY_GPS - uses GPS and Network providers to determine the location of the device. Consumes more power and has higher accuracy due to use of GPS.


To set locationQuality to HIGH_ACCURACY_GPS, use the following steps:

LSDLocationManager locationManager = LSDLocationManager.getInstance();

Requesting Location and Speed Updates

To enable/disable callback for any changes in location, listener for geo-location needs to be registered/deregistered respectively.


// location listener object
private final LSDLocationListener lsdLocationListener = new LSDLocationListener() {
        public void onLocationChange(Location location) {
          // Use location object to get coordinates, altitude etc.

        public void onSpeedChange(float currentSpeed) {
          // Utilize currentSpeed value in ttc calculation etc.

// location manager object
LSDLocationManager locationManager = LSDLocationManager.getInstance();

// Register listener

// Deregister listener

// Deregister all listeners

results matching ""

    No results matching ""