0

I'm trying to check the 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.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Demonofloom
  • 240
  • 4
  • 17

1 Answers1

2

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_*

Ali Irawan
  • 2,094
  • 2
  • 18
  • 23