Course Content

If you are facing any issue in playing video please use Firefox browser.

Course Content

Description

Messaging in Android

 

In this video our topic is Messaging in Android.

As we have seen that to perform call related operations we need TelephonyManager. So now to perform SMS operations, we need SMS Manager.

Using the SMS manager, you can replace the native SMS application for create new applications that send text messages, react to incoming texts, or use SMS as a data transport layer.

We can get a reference to the SMS manager using the static method,

SmsManager smsManger = SmsManger.getDefault();

To send SMS messages, your application requires SEND_SMS permission.

To send a text message we will use sendTextMessage method.

Example :

String sendTo="5551234";

String myMessage="Android supports programmatic SMS messaging!";

smsManager.sendTextMessage(sendTo,null,myMessage,null,null);

The final two parameters let you specify intents to track the transmission and successful delivery of your messages. To react to these Intents, create and register Broadcast Receivers.

FAQs

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download The Apps

Code Scan or Download the app
Google Play Store
297K+ Downloads
4.5 Rating
10K+ Reviews
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere