|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.gps.GPSSettings
public class GPSSettings
Provides access to the internal GPS receiver of the BlackBerry device.
Field Summary | ||
---|---|---|
|
static int |
AUTH_LIFETIME_ERROR
Indicates an internal error has occurred when retrieving the authentication life time value. |
|
static int |
AUTH_LIFETIME_UNSET
Indicates that the authentication life time value was not set by the network. |
Method Summary | ||
---|---|---|
|
static int |
getAuthLifeTime()
Returns the authentication life time value that is received from the network. |
|
static boolean |
isPDEInfoRequired(int mode)
Determines whether Position Determination Entity (PDE) information must be specified to retrieve an assisted GPS position. |
|
static void |
setApplicationId(String id)
Sets the application ID (also referred to as client ID) parameter of the PDE credentials. |
|
static void |
setApplicationPassword(String password)
Sets the password parameter of the PDE credentials. |
|
static void |
setMPC(String mpcHost,
int mpcPort)
Sets the Mobile Position Center (MPC) host URL and port parameters of the PDE credentials. |
|
static boolean |
setPDEInfo(String ip,
int port)
Sets the given PDE IP address and port number for the BlackBerry device. |
|
static boolean |
setPDEInfo(String ip,
int port,
int authLifeTime)
Sets the given PDE IP address, port number, and authentication life time values for the BlackBerry device. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int AUTH_LIFETIME_ERROR
The authentication life time value indicates the time period for which PDE authentication is valid. The authentication life time value is sent by the network after authentication is performed by the PDE server.
public static final int AUTH_LIFETIME_UNSET
The authentication life time value indicates the time period for which PDE authentication is valid. The authentication life time value is sent by the network after authentication is performed by the PDE server.
Method Detail |
---|
public static boolean isPDEInfoRequired(int mode)
mode
- The requested GPS mode.
true
if the application must set the PDE information, false
otherwise.public static boolean setPDEInfo(String ip, int port) throws IllegalArgumentException
Some wireless service providers require that your application call this method with the correct IP address and port number values of the PDE before your application can use the Location API. To obtain the required IP address and port number for the PDE server, contact the wireless service provider.
ip
- The IP address for the PDE server.port
- The port number for the PDE server.
true
if the IP address and port number values are valid, false
otherwise.
UnsupportedOperationException
- if a BlackBerry device with a non-Qualcomm chipset
tries to invoke this method. This exception is also thrown if
the application is not allowed to use the internal GPS receiver.
IllegalArgumentException
- if the IP address string is not in the correct format.
NullPointerException
- if the IP address is null
.public static boolean setPDEInfo(String ip, int port, int authLifeTime) throws IllegalArgumentException
Some wireless service providers require that your application call this method with the correct IP address, port number, and authentication life time values of the PDE before your application can use the Location API. To obtain the required IP address and port number for the PDE server, contact the wireless service provider.
ip
- The IP address for the PDE server.port
- The port number for the PDE server.authLifeTime
- The authentication life time value (in seconds) for the PDE server.
true
if the IP address, port number, and
authentication life time values are valid, false
otherwise.
UnsupportedOperationException
- if a BlackBerry device with a non-Qualcomm chipset
tries to invoke this method. This exception is also thrown if
the application is not allowed to use the internal GPS receiver.
IllegalArgumentException
- If the IP address string is not in the correct format.
NullPointerException
- if the IP address is null
.public static int getAuthLifeTime() throws UnsupportedOperationException
The authentication life time value indicates the time period for which PDE authentication is valid. The authentication life time value is sent by the network after authentication is performed by the PDE server.
Note: This method should be called only after invoking
the GPSSettings.setPDEInfo(String ip, int port, int authLifeTime)
method.
AUTH_LIFETIME_ERROR
-
if this process did not invoke setPDEInfo(String ip, int port, int authLifeTime)
.
AUTH_LIFETIME_UNSET
- if the authentication
life time value was not yet set by the network.
UnsupportedOperationException
- if a BlackBerry device with a non-Qualcomm chipset
tries to invoke this method, or a BlackBerry device that operates on a CDMA network
invokes this method for a wireless service provider that is not supported.public static void setApplicationId(String id) throws IllegalArgumentException
Some wireless service providers require that your application call this method with the correct PDE credential values before your application can use the Location API. To obtain the required PDE credential values, contact the wireless service provider.
id
- The application ID of the calling application.
UnsupportedOperationException
- if a BlackBerry device with a non-Qualcomm chipset
tries to invoke this method, or a BlackBerry device that operates on a CDMA network
invokes this method for a wireless service provider that is not supported.
This exception is also thrown if the application is not allowed to use the internal
GPS receiver.
IllegalArgumentException
- if the application ID string is not in the correct format.public static void setApplicationPassword(String password) throws IllegalArgumentException
Some wireless service providers require that your application call this method with the correct PDE credential values before your application can use the Location API. To obtain the required PDE credential values, contact the wireless service provider.
password
- The password of the calling application.
UnsupportedOperationException
- if a BlackBerry device with a non-Qualcomm chipset
tries to invoke this method, or a BlackBerry device that operates on a CDMA network
invokes this method for a wireless service provider that is not supported.
This exception is also thrown if the application is not allowed to use the internal
GPS receiver.
IllegalArgumentException
- if the password string is not in the correct format.public static void setMPC(String mpcHost, int mpcPort) throws IllegalArgumentException
Some wireless service providers require that your application call this method with the correct PDE credential values before your application can use the Location API. To obtain the required PDE credential values, contact the wireless service provider.
mpcHost
- The URL of the PDE host.mpcPort
- The PDE authorization port number.
UnsupportedOperationException
- if a BlackBerry device with a non-Qualcomm chipset
tries to invoke this method, or a BlackBerry device that operates on a CDMA network
invokes this method for a wireless service provider that is not supported.
This exception is also thrown if the application is not allowed to use the internal
GPS receiver.
IllegalArgumentException
- if the host URL or port string is not in the correct format,
or if the application Id has not been set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal