在Android
,檢查互聯網連接就是這樣。如何檢查黑莓設備是否連接到互聯網連接?
public boolean isOnline() {
ConnectivityManager cm = (ConnectivityManager) activity
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
if (netInfo != null && netInfo.isConnectedOrConnecting()) {
return true;
}
return false;
}
黑莓RIM怎麼樣?
p/s *:我不是要求檢查可用連接或連接的類型。
查看API [** Class CoverageInfo **](http://www.blackberry.com/developers/docs/7.0.0api/net/rim/device/api/system/CoverageInfo.html) – BBdev 2012-07-10 08:54:49
請參閱[網絡診斷工具](http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is_-_Network_Diagnostic_Tool.html?nodeid=1450596&vernum=0)和[黑莓連接問題] (http://develop-for-fun.blogspot.com/2011/05/blackberry-connectivity-issues.html)。 – 2012-07-17 07:11:29