Interface GeoUniq.ILocationListener

Enclosing class:
GeoUniq

public static interface GeoUniq.ILocationListener
Defines callback methods to receive Location objects after calling GeoUniq.getLocation(float, ILocationListener, IErrorListener).

Implementing this interface is necessary to obtain the location of the device locally in the mobile application (See GeoUniq.getLocation(float, ILocationListener, IErrorListener)).

  • Method Details

    • onLocationListened

      void onLocationListened(android.location.Location location)
      Callback method called each time a new Location is detected until onFinalLocationListened(android.location.Location) is called.

      This method is called when a new location is available and GeoUniq SDK is still working to detect a more accurate location.

      When the location is requested by calling GeoUniq.getLocation(float, ILocationListener, IErrorListener), GeoUniq SDK may call this method several times. However, if this callback is invoked at least once, then the callback onFinalLocationListened(android.location.Location) will be invoked as last callback, indicating that GeoUniq SDK has stopped working to fulfill the location request.

      The first time this method is called, the argument location generally contains a cached Location that had been detected in a previous time.

      Parameters:
      location - a Location object with the last detected location
    • onFinalLocationListened

      void onFinalLocationListened(android.location.Location location)
      Callback method called when no other Location object will be returned.

      This method is called when GeoUniq SDK has managed to detect the location with the desired accuracy or in any case after a while.

      After this method is called, the method onLocationListened(android.location.Location) will not be called anymore and GeoUniq SDK will stop detecting the location.

      The Location object that is returned contains the location with the best accuracy among the various locations that have been detected.

      This method is always called if the callback onLocationListened(android.location.Location) has been invoked at least once. Otherwise, if the location of the device is completely unknown, the callback GeoUniq.IErrorListener.onError(GeoUniq.RequestResult) will be called indicating the specific error.

      Parameters:
      location - a Location object with the most accurate location among those detected