LiLocationCallback Reference
Package: applicasa.LiCore
Declared In: applicasa.LiCore.LiLocationCallback
Overview
LiLocationCallback is a public interface developers can extend in their own application classes for responding to location-related requests. Developers will find this callback interface required by the LiUserLocation.getLocation() and LiUserLocation.setLocationCallback() class methods.
Tasks
Responding to Location Updates
getLastBestUpdatedLocation(LiLocation, boolean)
getLastBestLocation(LiLocation)
Handling Errors
Interface Methods
getLastBestUpdatedLocation(LiLocation, boolean)
Called when location is updated.
public void getLastBestUpdatedLocation(LiLocation location, boolean updateSuccessful)
Parameters:
location
An LiLocation instance indicating current or last-known location.
updateSuccessful
A boolean that indicates if the location update operation was successful.
Discussion:
Responds to location updates that also update user data. This method should be implemented by classes that wish to take action on automatic and non-automatic location updates.
LiLocation is an internally customized extension of android.location.Location. Refer to the android.location.Location documentation for more information on interacting with Location objects.
getLastBestLocation(LiLocation)
Called when a non-updating location action has been performed (e.g., getting a user's current location without updating user data).
public void getLastBestLocation(LiLocation location)
Parameters:
location
An LiLocation instance indicating current or last-known location.
Discussion:
Responds to one-shot, non-user-updating location changes. This method should be implemented by classes that wish to take action after getting a user's current location.
LiLocation is an internally customized extension of android.location.Location. Refer to the android.location.Location documentation for more information on interacting with Location objects.
onFailure(LiErrorHandler)
Called when a location update fails to allow error handling.
public void onFailure(LiErrorHandler error)
Parameters:
error
An LiErrorHandler instance for processing errors.
Discussion:
Applicasa location actions will call the onFailure() method of your provided LiLocationCallback whenever location actions fail. The LiErrorHandler class implements the standard Exception interface and will provide access to error type, message, and other pertinent information for further processing.