Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if a phone can send SMS

Tags:

java

android

I've already read some related question about it but most of them were targeting calls, not SMS. What I've found so far is:

TelephonyManager manager = (TelephonyManager) context
        .getSystemService(Context.TELEPHONY_SERVICE);
if (manager.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE) {
    // I guess here are devices that are unable to send SMS
} else {
    // can send SMS
}

Is this true, devices with TelephonyManager.PHONE_TYPE_NONE are unable to send SMS? I don't really understand the description of TelephonyManager.PHONE_TYPE_NONE, which is "No phone radio."

Thanks!

like image 783
Marko Niciforovic Avatar asked Oct 05 '22 11:10

Marko Niciforovic


1 Answers

Yes with TelephonyManager.PHONE_TYPE_NONE you can't send SMS.As radio network is required to send SMS. However you can use some IP based messengers like whats app, ebuddy on them

if you see android.hardware.telephony (which you specify using uses-feature tag in Android manifest file), you will notice send/read/write SMS are mentioned under this feature.

Galaxy TAB example,Can't make calls still phone type comes as PHONE_TYPE_CDMA, so adding additional check for line number will be required for such cases, as shown in above link

like image 146
Akhil Avatar answered Oct 13 '22 09:10

Akhil