Class LocationRequest
java.lang.Object
com.codename1.location.LocationRequest
This class is used when requesting to listen to location update.
See
l, com.codename1.location.LocationRequest req) setLocationListener-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intWhen you need gps location updatesstatic final intWhen accuracy is not important and you want to save batterystatic final intWhen accuracy is not highly important and you want to save battery -
Constructor Summary
ConstructorsConstructorDescriptionEmpty ConstructorLocationRequest(int priority, long interval) Simple Constructor -
Method Summary
Modifier and TypeMethodDescriptionlongGest the request time intervalintGets the request priorityMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Field Details
-
PRIORITY_HIGH_ACCUARCY
public static final int PRIORITY_HIGH_ACCUARCYWhen you need gps location updates- See Also:
-
PRIORITY_MEDIUM_ACCUARCY
public static final int PRIORITY_MEDIUM_ACCUARCYWhen accuracy is not highly important and you want to save battery- See Also:
-
PRIORITY_LOW_ACCUARCY
public static final int PRIORITY_LOW_ACCUARCYWhen accuracy is not important and you want to save battery- See Also:
-
-
Constructor Details
-
LocationRequest
public LocationRequest()Empty Constructor -
LocationRequest
public LocationRequest(int priority, long interval) Simple Constructor
Parameters
-
priority: @param priority The priority we are interested to listen for location updates. PRIORITY_HIGH_ACCUARCY, PRIORITY_MEDIUM_ACCUARCY, PRIORITY_LOW_ACCUARCY High priority means gps locations which is CPU intensive and consumes more battery. Medium priority is less intensive in terms of battery and might return a gps or a network location which is less accurate. Low priority won't consume the battery and will return a gps location if available otherwise the location would be a network location. -
interval: @param interval time in milliseconds which determines what are the time intervals that we would like to get updates from the OS. This is a request only and might not be respected by the underlying OS
-
-
-
Method Details
-
getPriority
public int getPriority()Gets the request priority -
getInterval
public long getInterval()Gest the request time interval
-