Android Location Manager API List
Android Location Manager API List

Android Location Manager API List

  • Public void request Location Updates (String provider, long minTime, float minDistance, LocationListener listener).
    • Provider: The name of the provider with which to register. This value must never be null. minTime: Minimum time interval between location updates in milliseconds.
      minDistance: Minimum distance between location updates in meters.
      Listener: A Location Listener whose LocationListener#onLocationChanged method will be called for each location update This value must never be null.
  • Get Current Location in A11 and higher:
    • Public void getCurrentLocation(String provider, CancellationSignal cancellationSignaol, Executor executor, Consumer<Location>consumer): Returns a single location update from the very recent past.
      Provider: The name of the provider with which to register. This value must never be null.
      CancellationSignal: Used to cancel the operation, no callback should be expected after the cancellation.
      Executor: The callback will take place for this executor.
      Consumer: The callback invoked with either a Location or null.
  • Get Current Location in A10:
    • public void requestSingleUpdate(String provider, LocationListener listener, Looper looper):
      Provider: Name of the location provider
      Listener: The listener to receive location updates
      Looper: The looper handling listener callbacks, or null to use the looper of the calling thread