Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the procedure to detect if an Android device has SMS send capability?

Tags:

android

What is the procedure to detect if an Android device has SMS send capability? I want my app to know if the device has the capability to send an SMS message before trying to actually trying to send it. Thanks.

like image 522
Jay Koutavas Avatar asked Sep 28 '10 15:09

Jay Koutavas


People also ask

How do you know if my phone is SMS enabled?

To confirm that Verified SMS is enabled on your device, open the Messages app, tap the more_vert button, then tap Settings. If Verified SMS appears in Settings, Verified SMS is enabled on your device. If Verified SMS doesn't appear in Settings, Verified SMS isn't enabled on your device.

Which type of permission is required for sending SMS in android?

Sending an SMS message is permission-protected. Your app can't use SMS without the SEND_SMS permission line in AndroidManifest. xml. This permission line enables a setting for the app in the Settings app that gives the user the choice of allowing or disallowing use of SMS.

How do I know which app sends SMS?

AFAIK you cannot detect which app is sending the SMS. It's just not saved in the content storage. However, you could use an error-prone workaround: list all apps currently running which have the SEND_SMS permission (possibly with internet permission as well) when the SMS is sent.


1 Answers

if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {   // THIS PHONE HAS SMS FUNCTIONALITY } else {   // NO SMS HERE :( } 

That should work for API Level 5 and above.

like image 181
DanO Avatar answered Sep 25 '22 03:09

DanO