Home > DeveloperSection > Interviews > Describe the SmsManager class in android.

Posted on    May-29-2015 12:04 AM

 Android Android 
 1 Answer(s)
  795  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Posted on    May-29-2015 12:04 AM

SmsManager class is responsible for sending SMS from one emulator to another or device.

You cannot directly instantiate this class; instead, you call the getDefault() static method to obtain an SmsManager object. You then send the SMS message using the sendTextMessage() method:

SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage("5556", null, "Hello from MindStick", null, null);

sendTextMessage() method takes five argument.

  • destinationAddress — Phone number of the recipient.
  • scAddress — Service center address; you can use null also.
  • text — Content of the SMS message that you want to send.
  • sentIntent — Pending intent to invoke when the message is sent.
  • deliveryIntent — Pending intent to invoke when the message has been delivered.

Modified On May-29-2015 12:04:22 AM

Don't want to miss updates? Please click the below button!

Follow MindStick