我在哪里可以下载Blackberry网络诊断工具的源代码?

时间:2012-08-14 06:39:57

标签: blackberry java-me blackberry-jde

1 个答案:

答案 0 :(得分:3)

我想你错过了它。该链接位于该页面上,但超链接文本只是一个小字(“此处”),根据您的浏览器,这可能不会突出。

以下是源代码的完整链接:

http://www.blackberry.com/knowledgecentersupport/kmsupport/developerknowledgebase/zip/NetworkDiagnosticPublic.zip

我检查过,ReportScreen.java文件在那里:

    /**
     * Displays various network/radio info
     */
    public void displayNetworkInfo(){
            if(RadioInfo.getSignalLevel(RadioInfo.WAF_3GPP)!=RadioInfo.LEVEL_NO_COVERAGE){
                    add(new EditField("3GPP Signal Level: ",RadioInfo.getSignalLevel(RadioInfo.WAF_3GPP)+"dBm",255,EditField.READONLY));
                    add(new SeparatorField());
            }
            if(RadioInfo.getSignalLevel(RadioInfo.WAF_CDMA)!=RadioInfo.LEVEL_NO_COVERAGE){
                    add(new EditField("CDMA Signal Level: ",RadioInfo.getSignalLevel(RadioInfo.WAF_CDMA)+"dBm",255,EditField.READONLY));
                    add(new SeparatorField());
            }
            if(RadioInfo.getSignalLevel(RadioInfo.WAF_IDEN)!=RadioInfo.LEVEL_NO_COVERAGE){
                    add(new EditField("iDEN Signal Level: ",RadioInfo.getSignalLevel(RadioInfo.WAF_IDEN)+"dBm",255,EditField.READONLY));
                    add(new SeparatorField());
            }
            if(RadioInfo.getSignalLevel(RadioInfo.WAF_WLAN)!=RadioInfo.LEVEL_NO_COVERAGE){
                    add(new EditField("WLAN Signal Level: ",RadioInfo.getSignalLevel(RadioInfo.WAF_WLAN)+"dBm",255,EditField.READONLY));
                    add(new SeparatorField());
            }      

            add(new EditField("Network: ",RadioInfo.getCurrentNetworkName(),255,EditField.READONLY));
            add(new SeparatorField());

            String netType="";
            switch(RadioInfo.getNetworkType()){
                    case RadioInfo.NETWORK_CDMA:
                            netType="CDMA";
                            break;
                    case RadioInfo.NETWORK_GPRS:
                            netType="GPRS";
                            break;
                    case RadioInfo.NETWORK_IDEN:
                            netType="IDEN";
                            break;
                    case RadioInfo.NETWORK_NONE:
                            netType="NONE";
                            break;
                    case RadioInfo.NETWORK_UMTS:
                            netType="UMTS";
                            break;
                    case RadioInfo.NETWORK_802_11:
                            netType="802.11";
                            break;
                    default:
                            netType="Failed to determine";
            }
            add(new EditField("Network Type: ",netType,255,EditField.READONLY));
            add(new SeparatorField());

            int activeWAFS = RadioInfo.getNetworkService();
            String services = "";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_DATA)>0)
                    services+="Data + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_DIRECT_CONNECT)>0)
                    services+="Direct Connect + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_E911_CALLBACK_MODE)>0)
                    services+="E911 Callback + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_EDGE)>0)
                    services+="EDGE + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_EMERGENCY_ONLY)>0)
                    services+="Emergency Only + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_EVDO)>0 && RadioInfo.getNetworkType()==RadioInfo.NETWORK_CDMA)
                    services+="EVDO + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_EVDO_ONLY)>0)
                    services+="EVDO Only + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_GAN)>0)
                    services+="GAN + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_IN_CITY_ZONE)>0)
                    services+="City Zone + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_IN_HOME_ZONE)>0)
                    services+="Home Zone + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_MODEM_MODE_ENABLED)>0)
                    services+="Modem Mode + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_ROAMING)>0)
                    services+="Roaming + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_ROAMING_OFF_CAMPUS)>0)
                    services+="Roaming Off-campus + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_SUPPRESS_ROAMING)>0)
                    services+="Supress Roaming + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_UMTS)>0)
                    services+="UMTS + ";
            if((activeWAFS & RadioInfo.NETWORK_SERVICE_VOICE)>0)
                    services+="Voice + ";
            if(services.length()>2){
                    add(new EditField("Network Services: ",services.substring(0,services.length()-2),255,EditField.READONLY));
                    add(new SeparatorField());
            } else{
                    add(new EditField("Network Services: ","No Service Found",255,EditField.READONLY));
                    add(new SeparatorField());
            }

            add(new EditField("PIN: ",Integer.toHexString(DeviceInfo.getDeviceId())+"",255,EditField.READONLY));
            add(new SeparatorField());

            add(new EditField("Battery: ",DeviceInfo.getBatteryLevel()+"%",255,EditField.READONLY));
            add(new SeparatorField());

            add(new SeparatorField());
    }