How to send SMS programmatically from an Android application

Wondering how to use the RingCentral Platform to send SMS programmatically from within an Android application? RingCentral provides a set of SMS APIs for business applications that allows you to do that. Let’s take a look at how we can leverage them in this simple yet effective Android application.


  • Download / Clone the project source code from GitHub
  • Open the file “” and update the constant fields with your RingCentral application sandbox or production credentials. You will also need to provide JWT Credential, refer to this guide on how to create/access the same.
  • Run the project from Android Studio on a device or emulator.
  • Enter a valid phone number that can receive SMS and a standard text message and hit ‘Send’. Confirm the message on the recipient's device! If you’re using Sandbox credentials, the message will be prefixed with the following text “Test SMS using RingCentral Developer account”.

Key Components of the Application:

  • Module’s build.gradle file : This is how you install the RingCentral Java SDK and call the SMS APIs.
dependencies {
implementation 'com.ringcentral:ringcentral:2.8.4'

  • View Logic in activity_main.xml & The application has just a single activity that will look as seen below in the screenshot. It accepts user input — Recipient’s Phone Number & Text Message(limited to 160 characters) and performs the ‘Send SMS’ action, the outcome of which will be displayed as a Toast Message.
public class MainActivity extends AppCompatActivity implements Executor {

// When Send SMS button is pressed, create an SendSMS Object and pass it the number and text message
protected void onCreate(Bundle savedInstanceState) {
Log.i("Main Activity", "Listening for send press to send the SMS");
Button startBtn = (Button) findViewById(;
startBtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Context context = getApplicationContext();
EditText numberEditText = (EditText) findViewById((;
String recipientNumber = numberEditText.getText().toString();
EditText messageEditText = (EditText) findViewById(;
String messageContent = messageEditText.getText().toString();
SendSMS sendSMS = new SendSMS(recipientNumber, messageContent);
// Show Toast
Toast.makeText(context, "SMS Sent!", Toast.LENGTH_SHORT).show();
// Clear out fields after sms has been sent

// Perform executing of the run() method from SendSMS Class in a new thread
public void execute(Runnable runnable) {
new Thread(runnable).start();
  • Business Logic in : The logic of how to set up the RingCentral platform authorization and invocation of Creating and Sending Message can be found there. The network operation (HTTP POST Send SMS) is done with the help of the Executor object that uses the Runnable object and performs the operation in a separate thread so as to not lock up the main thread in the application.
  // Business logic of sending the SMS using RingCentral SendSMS API
public void run() {
try {
CreateSMSMessage postParameters = new CreateSMSMessage();
postParameters.from = new MessageStoreCallerInfoRequest().phoneNumber(RINGCENTRAL_DEV_NUMBER); = new MessageStoreCallerInfoRequest[]{
new MessageStoreCallerInfoRequest().phoneNumber(recipientNumber)
postParameters.text = smsMessage;
GetSMSMessageInfoResponse response = rc.restapi().account().extension().sms().post(postParameters);
Log.i("SendSMS", "SMS sent. Message status: " + response.messageStatus);
catch (RestException | IOException e) {
Log.e("Error Occurred", e.getMessage());

In this article, we learned how we can use RingCentral APIs in Android applications by using the Java SDK, which allows you to easily call any of the platform APIs. Please let us know what you think by leaving your questions and comments below. To learn even more about other features we have make sure to visit our developer site and if you’re ever stuck make sure to go to our developer forum.

Want to stay up to date and in the know about new APIs and features? Join our Game Changer Program and earn great rewards for building your skills and learning more about RingCentral!


  1. App and Code on GitHub :
  2. RingCentral SMS FAQ :
  3. Send SMS API :
  4. Java SDK :
  5. Android Executor :



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store