org.placelab.demo.jsr0179
Class Proximity
java.lang.Object
org.placelab.demo.jsr0179.Proximity
- All Implemented Interfaces:
- javax.microedition.location.ProximityListener
- public class Proximity
- extends java.lang.Object
- implements javax.microedition.location.ProximityListener
Sample class that demonstrates how to use the Location API to receive
notifications whenever you are within a certain proximity/radius of a given
coordinate.
|
Method Summary |
static void |
main(java.lang.String[] args)
|
void |
monitoringStateChanged(boolean isMonitoringActive)
Called to notify that the state of the proximity monitoring has changed. |
void |
proximityEvent(javax.microedition.location.Coordinates coordinates,
javax.microedition.location.Location location)
After registering this listener with the LocationProvider, this method
will be called by the platform when the implementation detects that the
current location of the terminal is within the defined proximity radius
of the registered coordinates. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Proximity
public Proximity()
monitoringStateChanged
public void monitoringStateChanged(boolean isMonitoringActive)
- Description copied from interface:
javax.microedition.location.ProximityListener
- Called to notify that the state of the proximity monitoring has changed.
These state changes are delivered to the application as soon as possible
after the state of the monitoring changes.
Regardless of the state, the ProximityListener remains registered until
the application explicitly removes it with
LocationProvider.removeProximityListener or the application exits.
These state changes may be related to state changes of some location
providers, but this is implementation dependent as implementations can
freely choose the method used to implement this proximity monitoring.
- Specified by:
monitoringStateChanged in interface javax.microedition.location.ProximityListener
- Parameters:
isMonitoringActive - a boolean indicating the new state of the proximity
monitoring. true indicates that the proximity monitoring is
active and false indicates that the proximity monitoring can't
be done currently.
proximityEvent
public void proximityEvent(javax.microedition.location.Coordinates coordinates,
javax.microedition.location.Location location)
- Description copied from interface:
javax.microedition.location.ProximityListener
- After registering this listener with the LocationProvider, this method
will be called by the platform when the implementation detects that the
current location of the terminal is within the defined proximity radius
of the registered coordinates.
- Specified by:
proximityEvent in interface javax.microedition.location.ProximityListener
- Parameters:
coordinates - the registered coordinates to which proximity has been
detectedlocation - the current location of the terminal
main
public static void main(java.lang.String[] args)