Download the New LearnVern Android App and enter Lucky Draw to win Free Certificate
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.
String myMessage="Android supports programmatic SMS messaging!";
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.
Have a friend to whom you would want to share this course?