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 …
Update 3/20/20: If you are building something like this to help out your community, please check whether the Twilio.org Impact Access Program can help you. We have expanded eligibility to include volunteer groups and companies working on communications for public benefit to support COVID-19 response.
I am sure many of you saw posts from people setting up groups of Covid-19 volunteers on social media over the weekend. We did, and joined a group of volunteers coordinating how to support the vulnerable in our villages in Somerset, UK.
The volunteer group's first idea was to post leaflets through peoples doors with our own phone numbers as a point of contact, following the advice of Covid-19 Mutual Aid UK.
“Bear in mind that whilst Facebook or WhatsApp are good organising platforms, they might not be the easiest way for vulnerable people in your area to find and contact your group. Those …
Java will celebrate its 25th birthday this May, and just before that, on March 17th Java 14 will be released. As well as language features, every new release has included lots of improvements in tooling, security, debugging, efficiency and of course performance. All the while the Java team has maintained backward compatibility so that you can always use code written for previous versions.
"Developer productivity and program performance, in the face of evolving paradigms, application areas, deployment styles and hardware."
- Mark Reinhold on Java’s long-term design goals
Since Java 9, releases have come regularly every 6 months. However many folks will be reluctant to update Java in all their environments twice a year. For developers it’s well worth investigating each release to see what new features are being added, even if you won’t use them in production right away.
With Java 14’s release approaching fast, this post gives a …
SMS can provide a timely channel for critical notification messages, even when users do not have a strong internet connection. This post will walk through how to build a dashboard for sending SMS to multiple users in Java using Spring Boot and Twilio.
Development Environment and Services
- You will need Java installed. The code in this post assumes you have Java 8 or newer. For easy installation of Java versions I recommend SDKMAN!
- A Twilio account - you can create one here. Note that this link has a referral code in it which gives an extra $10 when you upgrade your account.
The quickest way to get started with a new Spring Boot application is to use the Spring Initializr.
Head to start.spring.io and for this project, leave the defaults of “Maven Project”, “Java” and Spring Boot version “2.2.5” as they are. For Project Metadata you can …
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.
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 …
We spend a lot of time sorting out future plans, and there are some people who seem to have their whole calendar in mind at a moment’s notice. Whether it’s planning to hang out with friends or setting up meetings with colleagues, you can acquire a mystical air by knowing a quick mathematical trick to calculate the day of the week for any date. With a little practice, you can do it in a matter of seconds while others are still fumbling their phones out of their pockets.
In this post, I’ll explain the so-called Doomsday algorithm, and walk you through setting up an SMS chatbot for practising.
The Doomsday Algorithm
Websockets are a web technology used to create long-lived bidirectional connections between a client and web server over the internet. With Twilio Media Streams you can stream real time audio from a phone call to your web application using WebSockets.
This blog post will show how to create a WebSocket server in Java using Spring Boot which will receive real time audio from a phone call, and forward the audio data to Google’s Speech-to-Text to provide a live transcription of the voices on the call.
In order to follow along, you will need to have:
If you just want to skip to the end, you can check out the completed project on GitHub.
The fastest way to create a new project with Spring Boot is to use the Spring Initializr. Leave Project, …
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.
- Java. I’m using JDK 11 but 8 is fine too.
- A free SendGrid account
- The SendGrid helper library for Java
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.
Choose “Create & View” …
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:
In this post I’ll walk you through how to create this and customise it …
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 …