Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now
Build the future of communications.
Start building for free

"java" posts

  • By Matthew Gilliard
    How to build a Conference line with Twilio and Java How to build a Conference line with Twilio and Java

    Another conference call, another app, another PIN, another log-in. Joining conference calls should be as easy as dialing a phone number, without the hassle of so many extra digits. This post will show how you can build a conference line that anyone and everyone can join, using Twilio with Java and Spring Boot.

    Java Development Environment Setup

    Start by making sure you have the right software installed that you'll need to use for the rest of this post. You will need:

    • Java - You’ll need at least Java 8. My preferred way to install it is using SDKMAN!
    • A free Twilio account and a Twilio phone number

    Starting out with Spring Boot

    You can use SDKMAN! to install the Spring Boot cli tool with sdk install springboot. Use this to create a new project in an empty directory with:

    spring init \
      --dependencies web \
      --build maven \
      --groupId …
    Read More
  • By Aaron Alaniz
    Deploy your own video collaboration app in five minutes or less Deploy your own video collaboration app in 5 minutes or less

    Today we are excited to announce that we are open sourcing three video collaboration applications, one for iOS, one for Android, and a ReactJS one for the Web. Whether you are building a healthcare, education, or general video collaboration solution, these apps can accelerate development by providing you with a fully functioning video app that can be deployed to the cloud in minutes. In addition, they provide a canonical reference for developers building out their communication solutions by showcasing the Programmable Video capabilities. These applications are available today on Github under the Apache 2.0 license:

    At Twilio we strive to build a reliable, extensible platform so that our customers can build high quality communication experiences in their applications. Our Video SDKs provide the API building blocks for mobile and web developers to create custom communications experiences in their apps. We believe …

    Read More
  • By Matthew Gilliard
    Using SDKMAN! to work with multiple versions of Java Using SDKMAN! to work with multiple versions of Java

    If you code in Java, you might be coding against Java 11, or 8, or maybe an even older version. You may also be prototyping code against newer versions of Java, the current version is 13. Java 14 will be released this month, and 15 later this year. At the same time, you might be investigating different builds of OpenJDK - there are several free alternatives. I use AdoptOpenJDK’s builds of OpenJDK which is an increasingly popular choice according to the JVM Ecosystem Report 2020.

    You could also be trying out different build tools like Maven and Gradle. I use both, depending on the project.

    Put bluntly, managing all this can be difficult. It’s not impossible to manage by hand, but it’s fiddly and if you get it wrong the error messages can be hard to understand.

    Enter SDKMAN! It’s a tool for managing the installation and selection …

    Read More
  • By Pooja Srinath
    Send SMS in Your Spring Boot App spring-boot-java-websockets.png

    In this article, you’ll learn how to use WebSocket API with Spring Boot and build a simple status delivery application at the end.

    WebSocket is a communication protocol that makes it possible to establish a two-way communication channel between a server and its client. Websockets are supported by most of the browsers that are commonly used today. 

    Create an Application

    First, you need to set up your Twilio account and a suitable phone number.

    Here are the steps to generate a project using Spring Initializr: 

    1. Go to http://start.spring.io/.
    2. Enter Artifact’s value as websocket-callback.
    3. Add Websocket in the dependencies section.
    4. Click Generate Project to download the project.
    5. Extract the downloaded zip file.
    6. Note: You will need Java 8 or …
    Read More
  • By Matthew Gilliard
    How to Send Email in Java using Twilio SendGrid How to Send Email in Java using Twilio SendGrid

    If you’re writing a Java app and you need to programmatically send some emails, the Twilio SendGrid API is just the thing you need.

    You’ll need to sign up for a free Twilio SendGrid account and create an API key. Then you can get started with a few lines of code.

    In this post I’ll go through each step to get you up and emailing in no time.

    Starting Out

    You’ll need:

    The first thing you should do is to create a SendGrid account. The free tier will work just fine for this tutorial. Once you are signed up and logged in, create an API key. You can choose any name you like, but make sure to save the key before moving on.

    A screenshot of the "Create API Key" dialog on the SendGrid  console, showing 3 options, of which I have selected "Full Access" and called my key "my-api-key"

    Choose “Create & View” …

    Read More
  • By Matthew Gilliard
    Wake up to Useful Daily Messages with Java and Azure Functions Wake up to Useful Daily Messages with Java and Azure Functions

    I wake up slowly. I often need a few minutes to remember where I am and what day it is. I usually have my phone handy - it’s my alarm clock, too. But then I decide to check the weather, and before I know it I’ve got carried away on Twitter, Reddit, email and so on. It takes me ages to start getting ready for the day. I decided to build a small app which would send me an SMS every morning. I can see what the day has in store without getting involved in anything online.

    I decided to use Azure Functions with a TimerTrigger to run some Java code every morning. The code pulls data from wttr.in and affirmations.dev, formats it into a dense (read: emoji-laden) message and sends it to me:

    An SMS in my messaging app: Good morning (weather: rain showers, temp +10 Celsius), Today is Monday, October 7. Remember you are a capable human being. Have a great day (rainbows and sparkles)

    In this post I’ll walk you through how to create this and customise it …

    Read More
  • By Matthew Gilliard
    Working with HTML on the Web Using Java and jsoup Working with HTML on the Web Using Java and jsoup

    So, you need to parse HTML in your Java application. Perhaps you are extracting data from a website that doesn’t have an API, or allowing users to put arbitrary HTML into your app and you need to check that they haven’t tried to do anything nasty?

    Have you tried using regular expressions?  It won’t end well. The author of that now-infamous text managed to recover from their distress enough to suggest using an XML parser (before, presumably, collapsing into the void). The problem with this is that an awful lot of the HTML in the world is not valid XML. People open tags without closing them, they nest tags wrongly, and generally commit all kinds of XML faux pas. Some non-XML constructs are perfectly valid HTML and admirably, browsers just cope with it.

    To adopt the flexible and stylish attitude of web browsers, you really need a dedicated …

    Read More
  • By Matthew Gilliard
    Getting Started with JavaFX Getting Started with JavaFX

    JavaFX is a Java toolkit for making GUI applications which run on Windows, MacOS or Linux and mobile. It is the successor to the old Swing and the older AWT toolkits.

    Since the release of Java 11 in 2018 JavaFX has been part of the OpenJDK project, so it is open-source and is developed by many people from many different companies. If you are interested in creating a desktop application today then I would recommend starting with JavaFX and not using Swing or AWT, but it can be hard to know how to get started.

    This post will walk you through creating a JavaFX desktop application from scratch - the application will use JavaFX’s controls module to draw a label with some text, then we’ll move on to creating an interactive app that can send SMS messages.

    What do I need in order to make a JavaFX Application?

    Read More
  • By Matthew Gilliard
    Getting Started with the Java Streams API Blog Header: Getting Started with the Java Streams API by Matthew Gilliard, Developer Evangelist

    The Streams API was added in 2014 with the release of Java 8 so you’ve almost certainly got it available today. It is used to pass a series of objects through a chain of operations, so we can program in a more functional style than plain iteration allows. Still, when working with collections many developers still reach for the classic for loop.

    In this post, I’ll introduce the terms used when talking about Streams, show some examples of each term and how they can be used together to create compact and descriptive code. Then I’ll show a real-world example of Streams code I wrote recently to pick winners in a raffle.

    What’s a Stream?

    A Stream is a (possibly never-ending) series of Objects. A Stream starts from a Source. The objects in a Stream flow through Intermediate Operations, each of which results in another stream, and are gathered …

    Read More
  • By Matthew Gilliard
    How to read and understand a Java Stacktrace Copy of Photo blog Header 2-2.png

    When things go wrong in a running Java application, often the first sign you will have is lines printed to the screen that look like this:

    Exception in thread "main" java.lang.RuntimeException: Something has gone wrong, aborting!
        at com.myproject.module.MyProject.badMethod(MyProject.java:22)
        at com.myproject.module.MyProject.oneMoreMethod(MyProject.java:18)
        at com.myproject.module.MyProject.anotherMethod(MyProject.java:14)
        at com.myproject.module.MyProject.someMethod(MyProject.java:10)
        at com.myproject.module.MyProject.main(MyProject.java:6)

    This is a Stacktrace, and in this post I'll explain what they are, how they are made and how to read and understand …

    Read More
  • Newer
    Sign up and start building
    Not ready yet? Talk to an expert.