Class MeridianLocationManager

java.lang.Object
com.arubanetworks.meridian.location.MeridianLocationManager

public class MeridianLocationManager extends Object
A helper class to make management of the bound location services provided by the Meridian SDK simple.

This class provides a listener for receiving new locations and events requesting the user be prompted to turn on certain services depending on the location information available.

Below is a sample use in which enabling requests are shown to the user with toast messages and a the current locations string representation is displayed on the screen:

  • Constructor Details

    • MeridianLocationManager

      public MeridianLocationManager(Context context, EditorKey appKey)
      Constructs a LocationServiceHelper using the given Context and EditorKey.
    • MeridianLocationManager

      public MeridianLocationManager(Context context, EditorKey appKey, MeridianLocationManager.LocationUpdateListener listener)
      Constructs a LocationServiceHelper using the given Context, EditorKey and LocationUpdateListener.
  • Method Details

    • startListeningForLocation

      public boolean startListeningForLocation()
      Binds to the location service and starts listening for new location updates.

      This method should be called in your Activity’s onStart method.

    • stopListeningForLocation

      public void stopListeningForLocation()
      Stops listening for locations and unbinds from the location service allowing it to clean itself up.

      This method should be called in your Activity’s onStop Method.

    • resetLocationManager

      public void resetLocationManager()
      Resets the location manager.

      In general this should not be called. Only use it if system conditions have changed since starting the location manager. For example, if the user accepted location permission while location manager is running.

    • setListener

      public void setListener(MeridianLocationManager.LocationUpdateListener listener)
      Sets the listener to receive location events.
    • getLastLocation

      public MeridianLocation getLastLocation()
      Gets the last known location.