Interface GeoUniq.ILocationListener
- Enclosing class:
- GeoUniq
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 Summary
Modifier and TypeMethodDescriptionvoidonFinalLocationListened(android.location.Location location) Callback method called when no otherLocationobject will be returned.voidonLocationListened(android.location.Location location) Callback method called each time a newLocationis detected untilonFinalLocationListened(android.location.Location)is called.
-
Method Details
-
onLocationListened
void onLocationListened(android.location.Location location) Callback method called each time a newLocationis detected untilonFinalLocationListened(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 callbackonFinalLocationListened(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
locationgenerally contains a cachedLocationthat had been detected in a previous time.- Parameters:
location- aLocationobject with the last detected location
-
onFinalLocationListened
void onFinalLocationListened(android.location.Location location) Callback method called when no otherLocationobject 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
Locationobject 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 callbackGeoUniq.IErrorListener.onError(GeoUniq.RequestResult)will be called indicating the specific error.- Parameters:
location- aLocationobject with the most accurate location among those detected
-