Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
How to make a network connection using a selected Destination Network in J2me
How to make a network connection using a selected Destination Network in Java ME?
Use IAPInfo API 1.0, available on devices with Java Runtime 1.4 to access Internet Access point and Destination Network information from the native database and use it with GCF, by appending the selected Destination Network's ID to the URL before passing it to Java Generic Connection Framework.
Get DN id & make connection
public StreamConnection getConnection(String DN_Name, String url) throws Exception
//Obtain IAPInfo object by factory
IAPInfo iapinfo = IAPInfo.getIAPInfo();
//Get Destination Network
DestinationNetwork dn = iap.getDestinationNetwork(DN_Name);
//Make connection using selected Destination Network, selected Destination Network's ID is append to URL which is passed to GCF
StreamConnection sc = (StreamConnection)Connector.open(dn.getURL(url));
Check your target device spec's (http://www.developer.nokia.com/Devices/Device_specifications/?filter1=all) for support of IAPInfo API on it before using it.