APN is not specified?

时光怂恿深爱的人放手 提交于 2019-12-21 05:11:29

问题


iam creating httpConnection ,but when run the application it gives following exception ?

java.io.IOException APN is not specified ?


回答1:


I think the See the Developer Knowledge Base article: 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;
    }



回答2:


More to the point,

http://supportforums.blackberry.com/t5/Java-Development/How-to-get-APN-Settings/td-p/1704995

It is not completely possible to put the APN settings in your url eg. there is no way to get the username and password.



来源:https://stackoverflow.com/questions/5620594/apn-is-not-specified

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!