user43995
user43995

Reputation: 597

Android : how to programatically determine whether the system has a 3G/4G radio?

I am programming a Nexus 7 and need to determine whether the system has a 3G/4G radio or not. How do I do that?

Upvotes: 0

Views: 881

Answers (2)

Gabe Sechan
Gabe Sechan

Reputation: 93728

Use TelephonyManager.getPhoneType (). Returned values are

PHONE_TYPE_NONE
PHONE_TYPE_GSM
PHONE_TYPE_CDMA
PHONE_TYPE_SIP

Checking if CDMA or GSM should work

Upvotes: 2

selbie
selbie

Reputation: 104589

You can probably just check for the presence of a mobile network type.

boolean hasRadio()
{
     ConnectivityManager connManager = (ConnectivityManager) getActivity().getSystemService(Activity.CONNECTIVITY_SERVICE);

     return (connManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE) != null);
}

Upvotes: 0

Related Questions