I'm trying to check t开发者_JAVA技巧he cellular network type of a blackberry. What I would like to retrieve is the type that is displayed in the top right of my screen.
So,2G, 3G, Edge or SOS (in emergencies). Currently the closest I have got is using the function getNetworkType, which always returns GPRS.
You can use getNetworkService()
for example
int service = RadioInfo.getNetworkService();
if ( (service & RadioInfo.NETWORK_SERVICE_DATA ) != 0 ){
// GPRS
}
if ( (service & RadioInfo.NETWORK_SERVICE_UMTS ) != 0 ){
// 3G
}
if ( (service & RadioInfo.NETWORK_SERVICE_EDGE ) != 0 ){
// EDGE
}
There are still other status, such as EVD0 for CDMA network Please check on RadioInfo.NETWORK_SERVICE_*
精彩评论