0

我的 BlackBerry 应用程序无法通过 BES 连接到互联网。它通过 Wifi、BIS、GPRS 等成功连接,但未检测到 BES 上的互联网连接。我检查了所有设置,浏览器连接到互联网,但没有连接到应用程序。我的连接方法如下:

static String connectionParameters = ""; 
     public static String checkInternetConnection(){
            //String connectionParameters = "";   
            if(CoverageInfo.getCoverageStatus() == CoverageInfo.COVERAGE_NONE)
            {
                connectionParameters=null;
            }    
            else
            {
                if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
                    // Connected to a WiFi access point
                    connectionParameters = ";interface=wifi";
                    } else {
                    int coverageStatus = CoverageInfo.getCoverageStatus();
                    ServiceRecord record = getWAP2ServiceRecord();
                    if (record != null
                    && (coverageStatus & CoverageInfo.COVERAGE_DIRECT) ==
                    CoverageInfo.COVERAGE_DIRECT) {
                    // Have network coverage and a WAP 2.0 service book record
                    connectionParameters = ";deviceside=true;ConnectionUID="
                    + record.getUid();
                    } else if ((coverageStatus & CoverageInfo.COVERAGE_MDS) ==
                    CoverageInfo.COVERAGE_MDS) {
                    // Have an MDS service book and network coverage
                    connectionParameters = ";deviceside=false";
                    } else if ((coverageStatus & CoverageInfo.COVERAGE_DIRECT) ==
                    CoverageInfo.COVERAGE_DIRECT) {
                    // Have network coverage but no WAP 2.0 service book record
                    connectionParameters = ";deviceside=true";
                    }

                }
            }

            return connectionParameters;
        }
            private static  ServiceRecord getWAP2ServiceRecord() {
                ServiceBook sb = ServiceBook.getSB();
                ServiceRecord[] records = sb.getRecords();
                for(int i = 0; i < records.length; i++) {
                String cid = records[i].getCid().toLowerCase();
                String uid = records[i].getUid().toLowerCase();

                if (cid.indexOf("wptcp") != -1 &&
                uid.indexOf("wifi") == -1 &&
                uid.indexOf("mms") == -1) {
                return records[i];
                }
                }
                return null;
                } 

请帮忙!

编辑:该应用程序正在尝试访问 Intranet 上可用的服务器。应用程序无法通过 BES 访问 Internet(谷歌网络服务)和 Intranet(本地服务器)。任何人都可以发表评论吗?

4

1 回答 1

0

首先,您检查您是否有足够的 BES 承保范围,当您有 BES 计划时,您会得到这个。

于 2013-10-30T22:31:07.320 回答