iam creates an httpConnection, but when the application starts, does it give the following exception?
java.io.IOException APN not specified?
I think that see the developer’s knowledge base article: the link can solve your problem http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is_-_Different_ways_to_make_an_HTTP_or_socket_connection.html?nodeid= 826935 & vernum = 0
also see this sample code
private static String getConnectionString(){ String connectionString=""; if(WLANInfo.getWLANState()==WLANInfo.WLAN_STATE_CONNECTED){ connectionString="?;interface=wifi"; } else if((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_MDS) == CoverageInfo.COVERAGE_MDS){ connectionString = "?;&deviceside=false"; } else if((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_DIRECT)==CoverageInfo.COVERAGE_DIRECT){ String carrierUid=getCarrierBIBSUid(); if(carrierUid == null) { connectionString = "?;deviceside=true"; } else{ connectionString = "?;deviceside=false?;connectionUID="+carrierUid + "?;ConnectionType=mds-public"; } } else if(CoverageInfo.getCoverageStatus() == CoverageInfo.COVERAGE_NONE) { } return connectionString; }
Moreover,
http://supportforums.blackberry.com/t5/Java-Development/How-to-get-APN-Settings/td-p/1704995
It is not possible to put APN settings in your URL, for example. There is no way to get username and password.