2011-05-11 53 views
2

我已經制定了黑莓應用程序,它從appworld批准,但它提供了以下錯誤嚴重隧道失敗錯誤黑莓

on 4.6 

Critical tunnel failure 

on 5.0 and 6.0 
ava.io APN not specified 

請幫助爲什麼這個錯誤即將到來,如何解決它

回答

3

我認爲問題是你沒有添加適當的連接後綴到網址。

按照鏈接可以解決你的問題: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

而且還OU可以使用下面的示例代碼:

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; 
    } 
+0

通過你現在沒有工作連接的鏈路。您能否描述我如何使用'getConnectionString()'方法? – CAMOBAP 2013-04-21 14:40:09

0

只是爲了澄清一些問題。

@Jisson你的答案是有幫助的

但你並沒有包括對方法getCarrierBIBSUid()

/** 
* Looks through the phone's service book for a carrier provided BIBS network 
* @return The uid used to connect to that network. 
*/ 
private static String getCarrierBIBSUid() 
{ 

    ServiceRecord[] records = ServiceBook.getSB().getRecords(); 
    int currentRecord; 

    for(currentRecord = 0; currentRecord < records.length; currentRecord++) 
    { 
     if(records[currentRecord].getCid().toLowerCase().equals("ippp")) 
     { 
      if(records[currentRecord].getName().toLowerCase().indexOf("bibs") >= 0) 
      { 
       return records[currentRecord].getUid(); 
      } 
     } 
    } 

    return null; 
} 

此外,它可能是有益的,包括

if (DeviceInfo.isSimulator()){ 
     return ";deviceSide=true";  
    } 

起初碼getConnectionString()方法的更多信息 欲瞭解更多信息,請參閱Melick's Blog

0

通過手機上的APN值自己並使用其他答案中建議的連接字符串代碼解決了此問題。

更改您的APN設置(南非)

On Home screen, click Options 
Click Advanced Options and then TCP 
Enter the APN: **internet** 
    username: **guest** 
    password: **guest** 
Press the Menu key and select Save 

(對於世界其他地方發現這裏設置) 從http://www.blackberrytune.com/blackberry-tcp-ip-apn-settings/http://www.blackberryfaq.com/index.php/Carrier_specific_APN/TCP_settings