LiUserLocation Reference


Package: com.applicasa.ApplicasaManager
Declared In: com.applicasa.ApplicasaManager.LiUserLocation

Overview


LiUserLocation is a helper class for LiCore framework, serving as the bridge class through which location-handling actions may be performed. By default, the Applicasa-supplied User class utilizes LiUserLocation methods. Developers may include these methods in their own code to allow Applicasa to handle Location needs as they wish.


Tasks


Location Configuration

setLocationCallback(LiLocationCallback)
setMinimumDistance(float)
setMinimumTime(long)

Location Handling

getLocation(LiLocationCallback)
updateLocation
startAutomaticLocationUpdate
stopAutomaticLocationUpdate

Enable/Disable GPS

enableGPS
disableGPS

Enable/Disable Network

enableNetwork
disableNetwork


Class Methods


getLocation(LiLocationCallback)

Class method to get a user's current location.

public static void getLocation(LiLocationCallback locationCallback)

Parameters:

locationCallback
The LiLocationCallback for taking action after a user's location is found.

Discussion:

Gets a user's current location, requiring a callback parameter for additional processing or action after location is found. The callback will receive the location response. If no callback is provided, the method will not return the location result.

updateLocation

Class method to update a user's current location.

public static void updateLocation()

Discussion:

Updates a user's current location. This method is to be used whenever you want Applicasa to update a user's location, but do not want Applicasa to continue automatically updating a user's location in the background. An example of this type of usage could be a simple location-based check-in type of action. Requires you have previous called setLocationCallback() with a callback method for additional processing or action after location update is complete.

startAutomaticLocationUpdate

Class method for continuing to update user location automatically as it changes over time.

public static void startAutomaticLocationUpdate()

Discussion:

Instructs Applicasa to continue to update user location changes automatically over time. Requires you have previous called setLocationCallback() with a callback method for additional processing or action after location update is complete.

stopAutomaticLocationUpdate

Instructs Applicasa to stop updating a user's location automatically

public static void stopAutomaticLocationUpdate()

Discussion:

Instructs Applicasa to stop updating a user's location automatically.

enableGPS

Class method for enabling a device's GPS capabilities.

public static void enableGPS()

Discussion:

Applicasa-provided helper method for enabling a device's GPS capabilities.

disableGPS

Class method for disabling a device's GPS capabilities.

public static void disableGPS()

Discussion:

Applicasa-provided helper method for disabling a device's GPS capabilities.

enableNetwork

Class method for enabling a device's network capabilities.

public static void enableNetwork()

Discussion:

Applicasa-provided helper method for enabling a device's network capabilities.

disableNetwork

Class method for disabling a device's network capabilities.

public static void disableNetwork()

Discussion:

Applicasa-provided helper method for disabling a device's network capabilities.

setLocationCallback(LiLocationCallback)

Setter for a callback method used by all location-related actions.

public static void setLocationCallback(LiLocationCallback liLocationCallback)

Parameters:

liLocationCallback
The LiLocationCallback for taking action after a user's location is found.

Discussion:

This method sets a callback method that will be used by LiUserLocation for its location-related methods, which include updateLocation(), startAutomaticLocationUpdate(), and getLocation(). The results from those methods will call the callback set by setLocationCallback().

If a callback is not set via setLocationCallback(), the location methods will not return a result when called, and applications may not behave as expected.

setMinimumDistance(float)

Sets the minimum distance above which location results may be returned.

public static void setMinimumDistance(float distance)

Parameters:

distance
A float value indicating the minimum distance for location results.

Discussion:

Only location results that exceed this minimum distance argument will be returned from LiUserLocation methods. If the value is not set, minimum distance defaults to 0.

setMinimumTime(long)

Sets the minimum time above which location results may be returned.

public static void setMinimumTime(long minTime)

Parameters:

minTime
A long value indicating the minimum time difference to use for location results.

Discussion:

Only location results whose last retrieval/update time exceeds this minTime argument will be returned from LiUserLocation methods. If the value is not set, minimum time defaults to 0.


  « Back to SDK Class List