How to Run the Backend Server for SMS Sending with Twilio

Reading This Manual

Copying all content from this file and pasting it at online markdown editor (like https://jbt.github.io/markdown-editor/) will not display images since they are stored locally within the repository. It is strongly recommended to read this document inside Atom text editor using Ctrl + Shift + M to display the rendered preview.

Introduction

Twilio is a developer platform for communications. Twilio API adds capabilities like voice, video, and messaging to the application. This enables businesses to provide the right communications experience for their customers. Behind Twilio API is a software layer that connects and optimizes communications networks around the world, allow to call and message anyone anywhere.
This manual aims to show how to run the Backend Server for using SMS Sending mechanism with Twilio on the local machine.

Dependencies

1. Android Studio
2. ngrok

How to Run the Backend Server for SMS Sending with Twilio

1. Open Android Studio, go to the menu File – Open

Open Android Studio

2. Choose the SMSBackend project.

Choose the Project

3. Run the Project. shadowJar is used for this purpose

Run the Project

4. When the build is finished go to the project tab and find the path build/libs/ There is the .jar file inside. Right-click on it and choose the point “Run”

Run the Snapshot

5. After finish, you can see the following information

Look at the Address
1. Check the http://127.0.0.1:4567/ in your browser. You should see the text “Hello world”
2. Open the ngrok window:

Open the ngrok
1. Type the command ngrok http 4567and press Enter
2. You should see the following. The application is available externally now

Results of ngrok
1. Return to Android Studio and open your project. Go to the Activity file and find the code that used for SMS sending. Replace the old link with the new link from ngrok:

Change the Link in the Activity File

1. Save and build the project.

Conclusion

Now you are know how to run the Backend Server for using SMS Sending mechanism with Twilio on your local machine.

Author: Natalia Tretiakova