Hare-Krishna
Hare-Krishna

Reputation: 1425

Programmatically how to know device service type like its CDMA/GSM/GPRS

I am trying to find a code that with help me to find out the device serive-type like CDMA / GSM . I have tried the code below but not helped.

DeviceInfo.getDeviceName();

Upvotes: 2

Views: 1085

Answers (1)

Fostah
Fostah

Reputation: 11796

You're looking for the RadioInfo class:

if(RadioInfo.getNetworkType() == RadioInfo.NETWORK_CDMA) {
    // Do something specific for CDMA
}

There are several network constants in RadioInfo, all prefixed with NETWORK_. See the docs linked to below for more details.

RadioInfo JavaDocs for 4.5

Upvotes: 5

Related Questions