Destination Network or Internet Access Point for connection is selected using the following criteria when the MIDlet opens a network connection:
Use IAP Info API and Generic Connection Framework
Nokia IAP Info API gives applications access to Internet Access Point (IAP) and Destination Network (SNAP) related information. For more information, see IAP Info API description.
Use cached Destination Network (SNAP) or Internet Access Point (IAP) which has been already selected by user
Use MIDlet suite default Destination Network (SNAP) if it is defined in Application Manager.
User is able to define Destination Network manually via MIDlet suite settings in Application Manager. User defined MIDlet suite default Destination Network is then used for all network connections automatically.
Prompt user for Destination Network (SNAP) or Internet Access Point (IAP) selection. If phone's Default Connection is defined, it is used instead and user is not prompt at all.
The User selection is cached and used in next opened network connections. The Session default exists until the running MIDlet is closed.
If opening a network connection fails when User defined Destination Network setting in Application Manager is used, the MIDlet suite default Destination Network (SNAP) is ignored until the running MIDlet instance is closed. After that, the user is prompted to make a new selection in the next opened network connection.
If a network connection has been successfully opened and the operation on that opened connection fails (for example if the device is out of network coverage of the selected Internet Access Point), the user is not prompted to select Destination Network (SNAP) or Internet Access Point (IAP) until the next connection is opened.
A MIDlet can avoid additional IAP selection prompts when it reconnects to same host by storing resolved IP address in a variable, such as in the code snippet below:
String url = "socket://host.com:79"; String address = ""; SocketConnection con = (SocketConnection)Connector.open(url); address = con.getAddress(); // IP address should be used in following connections // instead of host name
This workaround can be used with socket, SSL, HTTP and HTTPS connections.