Javatpoint Logo
Javatpoint Logo

How to send sms in android

We can send sms in android via intent. You need to write only 4 lines of code the send sms in android.

Example of sending sms in android


Drag the 2 edittexts, 2 textviews and 1 button from the pallete, now the activity_main.xml file will like this:

File: activity_main.xml

Write the permission code in Android-Manifest.xml file

You need to write SEND_SMS permission as given below:

File: Android-Manifest.xml

Activity class

Let's write the code to make the phone call via intent.


Install and Run the apk file on the Real Device (e.g. Mobile) to send the sms.


android send sms example output 1

android send sms example output 2

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA