How to send SMS using Twilio API in Java?

I came across a question on StackOverflow.com yesterday. As, I have used Twilio API to send SMS and do Phone Call many times. I signed up to help the OP.

If you wanna compile following code in your local box, then you need to have JSON.jar and commons-codec-1.8.jar JAR files. Download File Archive

I wrote this class to generalize any Web Related Helper Methods.

To output property, I used Bootstrap 2.3.2 in following JSP.

If you get all things working, the output would look like this.

TwilioMessageExample

Download Controller – JavaEE Servlet

Here is small piece of java code to generate binary stream which tells browser to save file as attachment. I believe that this code will help java beginners to understand HttpServletResponse of the Servlets.

Read More: http://commons.apache.org/fileupload/