0

In android there is option to make call immediately with code and there is an option to move the user to the caller app with the number and let him call himself. I have a code that move the user to the sms app with the content ready:

Uri smsUri = Uri.parse("sms:0542158081");
Intent intent = new Intent(Intent.ACTION_VIEW, smsUri);
intent.putExtra("sms_body", Text);
startActivity(intent);

but I want to send the sms immediately from the code like the phone call instead of waiting for the user. How can i do it?

1 Answers1

0

User SmsManager so

SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage("phoneNumber", null, "sms message", null, null);
Andrey Danilov
  • 6,194
  • 5
  • 32
  • 56