Java Reference
In-Depth Information
Preferred access points
Last-used access point.
The following code snippet demonstrates simple usage of the IAP infor-
mation:
// get the singleton IAPInfo object
IAPInfo iapInfo = IAPInfo.getIAPInfo();
// get the available Destination Networks and the list of IAPs
DestinationNetwork destNetworks[] = iapInfo.getDestinationNetworks();
if(destNetworks.length > 0) {
AccessPoint accessPoints[] = destNetworks [0].getAccessPoints();
} // get the last used IAP
AccessPoint lastUsedIAP = iapInfo.getLastUsedAccessPoint();
The Generic Connection Framework (GCF) of Java ME does not have
a notion of choosing between Internet Access Points and the default
behavior is to use the system default IAP. The IAP-Control feature of the
IAPInfo API allows code to explicitly specify the IAP that should be used
when creating a new GCF network. This is done by extending the GCF
URI scheme definition with two optional parameters: nokia_apnid
and nokia_netid . For example, this short code snippet opens a new
connection, using the IAP whose system ID is 2:
Connector.open("http://www.nokia.com;nokia_apnid=2")
The parameters are removed from the URL before opening the con-
nection. They are used internally without being sent to a web server.
AccessPoint.getURL(String aURL) is a convenience utility
method which returns a new URL string with the optional IAP ID param-
eter added. For example, the following snippet of code opens the new
connection with the IAP encapsulated by accessPoint :
AccessPoint accessPoint;
...
Connection.open(accessPoint.getURL("http://www.nokia.com"));
IAPs for Java applications on Symbian OS can also be set non-
programmatically. For more information, please refer to Section 3.7.2.
3.2.5 SNAP Mobile
The Scalable Network Application Package (SNAP) is Nokia's end-to-
end solution for developing connected Java games and creating mobile
Search WWH ::




Custom Search