public class VgMyLocationManager extends java.lang.Object implements VgMyLocationListener
Modifier | Constructor and Description |
---|---|
protected |
VgMyLocationManager() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(java.lang.String pName,
VgMyLocationListener pListener)
Adds the listener to the location manager and associates it with the
provider name.
|
void |
addProvider(VgMyLocationProvider pProvider)
Adds the provider to the location manager.
|
static VgMyLocationManager |
getInstance()
Use this method to retrieve the instance of the VgMyLocationManager class.
|
VgMyLocationProvider |
getProvider(java.lang.String pName)
Returns the information associated with the location provider of
the given name, or null if no provider exists by that name.
|
java.util.Vector<java.lang.String> |
getProviders(boolean pEnabledOnly)
Returns a list of the names of all known location providers.
|
void |
notifyAccuracyDidChange(java.lang.String pProvider,
double pAccuracy)
Called when the accuracy has changed.
|
void |
notifyContextDidChange(java.lang.String pProvider,
int pContext)
Called when the context has changed
|
void |
notifyFloorDidChange(java.lang.String pProvider,
java.lang.String pFloor)
Called when the floor has changed.
|
void |
notifyHeadingDidChange(java.lang.String pProvider,
double pHeading)
Called when the heading has changed.
|
void |
notifyLocationProviderDisabled(java.lang.String pProvider)
Called when the provider is disabled
|
void |
notifyLocationProviderEnabled(java.lang.String pProvider)
Called when the provider is enabled
|
void |
notifyPositionDidChange(java.lang.String pProvider,
VgPosition pPosition)
Called when the location has changed
|
void |
removeListener(java.lang.String pName,
VgMyLocationListener pListener)
Removes the listener from the location manager
|
void |
removeProvider(VgMyLocationProvider pProvider)
Removes the provider from the location manager.
|
public static VgMyLocationManager getInstance()
public VgMyLocationProvider getProvider(java.lang.String pName)
pName
- The provider namepublic java.util.Vector<java.lang.String> getProviders(boolean pEnabledOnly)
pEnabledOnly
- If true then only the providers which are
currently enabled are returned. By default is false.public void addProvider(VgMyLocationProvider pProvider)
pProvider
- The providerpublic void removeProvider(VgMyLocationProvider pProvider)
pProvider
- The providerpublic void addListener(java.lang.String pName, VgMyLocationListener pListener)
pName
- The name of the providerpListener
- The listenerpublic void removeListener(java.lang.String pName, VgMyLocationListener pListener)
pName
- The name of the providerpListener
- The listenerpublic void notifyPositionDidChange(java.lang.String pProvider, VgPosition pPosition)
VgMyLocationListener
notifyPositionDidChange
in interface VgMyLocationListener
pProvider
- The location provider responsible for sending the notificationpPosition
- The new positionpublic void notifyFloorDidChange(java.lang.String pProvider, java.lang.String pFloor)
VgMyLocationListener
notifyFloorDidChange
in interface VgMyLocationListener
pProvider
- The location provider responsible for sending the notification.pFloor
- The new floorpublic void notifyAccuracyDidChange(java.lang.String pProvider, double pAccuracy)
VgMyLocationListener
notifyAccuracyDidChange
in interface VgMyLocationListener
pProvider
- The location provider responsible for sending the notification.pAccuracy
- The new accuracypublic void notifyContextDidChange(java.lang.String pProvider, int pContext)
VgMyLocationListener
notifyContextDidChange
in interface VgMyLocationListener
pProvider
- The location provider responsible for sending the notification.pContext
- The new contextpublic void notifyHeadingDidChange(java.lang.String pProvider, double pHeading)
VgMyLocationListener
notifyHeadingDidChange
in interface VgMyLocationListener
pProvider
- The location provider responsible for sending the notification.pHeading
- The new headingpublic void notifyLocationProviderEnabled(java.lang.String pProvider)
VgMyLocationListener
notifyLocationProviderEnabled
in interface VgMyLocationListener
pProvider
- The location provider responsible for sending the notification.public void notifyLocationProviderDisabled(java.lang.String pProvider)
VgMyLocationListener
notifyLocationProviderDisabled
in interface VgMyLocationListener
pProvider
- The location provider responsible for sending the notification.