Send SMS By Starting Your Activity

This example explains how you can send sms by starting your activity.

Algorithm:

1.) Create a new project by File-> New -> Android Project name it SendSMSExample.

2.) Write following into main.xml:

 

3.) Add following permissions to your manifest file:

 

 

4.) Run for output.
Steps:

1.) Create a project named SendSMSExample and set the information as stated in the image.

Build Target: Android 4.4
Application Name: SendSMSExample
Package Name: com.example.SendSMSExample
Activity Name: SendSMSExampleActivity

sendsms1

2.) Open SendSMSExampleActivity.java file and write following code there:

 

3.) Compile and build the project.

NOTE: Check on device for actual output.