The documented way to detect presence of the telephony module on android is to check FEATURE_TELEPHONY feature. Unfortunately on some smartphones and on emulator the check returns false even when the phone is present. So it's not a reliable way as it gives false negatives.
I've found a way to obtain telephony manager (TelephonyManager tm=(TelephonyManager )this.getSystemService(Context.TELEPHONY_SERVICE);
but it gives false positive at least on Nexus 7 tablet.
My goal is to hide options related to phone calls and SMS sending from my widget, if those phone calls or SMS sending are not possible.
Does the reliable method to solve my task exist on Android 2.2 and later?
(TelephonyManager tm=(TelephonyManager )this.getSystemService(Context.TELEPHONY_SERVICE);
I don't know why above code is returning false positive, but why don't you check its network type or network operator with telephony manager? For example, it might be returning NETWORK_TYPE_UNKNOWN flag for nexus 7.
return (android.telephony.TelephonyManager.getNetworkType()
!= android.telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN)
Refernce: