I am trying to send an sms using intent i am able to send the phone number and the text to send but after running the line startActivity(smsIntent); the problem is the user have to press the "send" button.
Asked
Active
Viewed 105 times
-1
-
1https://stackoverflow.com/questions/7620150/can-i-automatically-send-sms-without-the-user-need-to-approve/7620220#7620220 – Sunny Sep 18 '17 at 14:54
-
i dont understand what are the values of SMS_SENT,SMS_PORT,MAX_SMS_MESSAGE_LENGTH,SMS_DELIVERED – adi181188 Sep 18 '17 at 16:25
-
see the comments there. – Sunny Sep 19 '17 at 07:32
-
if piSend and piDelivered are Pending Intent then why are they only used when length < MAX_SMS_MESSAGE_LENGTH? – adi181188 Sep 19 '17 at 08:10
-
after reading the comments besides SMS_SENT there are no explanations for the other values(i dont understand SMS_SENT too why it needs to be my.app?). – adi181188 Sep 19 '17 at 08:13
-
1SMS_SENT and SMS_RECEIVED are constant for e.g.`final String SMS_SENT= "sms_sent"` – Sunny Sep 19 '17 at 08:30
-
1it does not need to be my.app you can put anything here – Sunny Sep 19 '17 at 08:35
-
ok and what about piSend and piDelivered why are they only used when the message length is smaller then the MAX_SMS_MESSAGE_LENGTH? – adi181188 Sep 19 '17 at 09:20
-
1MAX_SMS_MESSAGE_LENGTH = 160 piSend and piDelivered are already explained there. – Sunny Sep 19 '17 at 09:29
-
i understand piSend and piDelivered are used in a normal case but why not when we call manager.sendMultipartTextMessage(phonenumber, null, messagelist, null, null);? – adi181188 Sep 19 '17 at 12:15
-
1you can call, but you will not get notify when sms has been sent. – Sunny Sep 19 '17 at 12:48
-
thank you in the end youre solution worked – adi181188 Sep 19 '17 at 15:04
-
Glad it works. Please upvote if it helped :) – Sunny Sep 21 '17 at 05:01
1 Answers
3
Send it directly using SmsManager
. This will require the SEND_SMS
permission.
If you delegate the work to a third-party app (e.g., via ACTION_SEND
or ACTION_SENDTO
), then the user and the other app decide if and when to send the SMS, not you. You are merely suggesting an SMS to send.

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
-
SmsManager does not work for me and from what i understand it does not show the sms at the inbox of the end device – adi181188 Sep 18 '17 at 16:19
-
1
-
if i delegate the work to a third-party app(i use ACTION_SEND) is there a way to to send it and not only create it?. like suggesting to actually send – adi181188 Sep 19 '17 at 08:18
-
1