Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send SMS message using non default SMS app on Android 4.4

Can I send SMS using no default SMS app on Android 4.4 Kitkat?

It means, Can I send SMS without ability to write to SMS Provider?

I confused about that on Android 4.4 Kitkat.

I wonder I can just send SMS using non default SMS app or not.

like image 255
harrison Avatar asked Oct 24 '13 08:10

harrison


People also ask

How do I change my default SMS app on Android?

Navigate to and open Settings, and then tap Apps. Tap Choose default apps, and then tap SMS app. Select your desired message app.

What is the default SMS app on Android?

Verizon officially makes Google Messages the default messaging app for all Android phones. At the start of July, AT&T announced that it was changing the default text messaging app for all of its Android phones to Google Messages.


2 Answers

You can send SMS even if your app isn't the default SMS app.

However, you won't be able to use the SMS provider.

That's the whole point of the new version - to make it clear to the user which app is allowed to use special SMS operations and have only one default app for this.

look at this text (taken from android developer blog) :

In consideration of some apps that do not want to behave as the default SMS app but still want to send messages, any app that has the SEND_SMS permission is still able to send SMS messages using SmsManager. If and only if an app is not selected as the default SMS app on Android 4.4, the system automatically writes the sent SMS messages to the SMS Provider (the default SMS app is always responsible for writing its sent messages to the SMS Provider).

so, in short, if all you need is to send and receive SMS, you can still do it.

however, some operations require that you will have your app as the default SMS app.

like image 151
android developer Avatar answered Sep 27 '22 21:09

android developer


You can try this code:

PendingIntent sentPI = PendingIntent.getBroadcast(context, 0, new Intent(SENT), 0);

PendingIntent deliveredPI = PendingIntent.getBroadcast(context, 0, new Intent(DELIVERED), 0);

android.telephony.SmsManager.getDefault().sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI);

And in Manifest:

<uses-permission android:name="android.permission.SEND_SMS" />

It don't need confirmation from user if sending number don't 4,5,6 - digits.

like image 24
Peter Zverkov Avatar answered Sep 27 '22 21:09

Peter Zverkov