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 Diane Phan
    How to Run Ngrok Using Java header - How to Use Java Servlets with Ngrok

    Java programmers can benefit from using servlets because they provide an opportunity to understand low-level concepts in Java. Servlets are also great for building interactive web applications and dynamic web pages because they extend apps hosted by web servers. They handle HTTP requests between a browser and any client, database, or application on the HTTP server.

    However, building a local servlet is just the first step. Taking the servlet a step further to communicate with a temporary public domain can allow developers to use webhooks, share a working demo of the project, and more.

    In this article, you will learn how to build and run a servlet to host your Java application and expose it publicly to the web.

    Prerequisites

    Install ngrok

    Ngrok is a great tool because it allows you to create a temporary public domain that redirects HTTP requests …

    Read More
  • By Diane Phan
    How to Start Your First Java Spark App header - How to Start Your First Java Spark App

    Setting up a new project to hack together an idea shouldn't be a problem, especially with the help of the Spark framework. Not only does this lightweight framework allow developers to be more productive with minimal boilerplate, but explore REST APIs at the same time.

    In this article, you will learn how to navigate a Java IDE to set up and build a Java Spark application.

    Tutorial requirements

    Start a new Java project in IntelliJ

    Open IntelliJ Idea and click on Create New Project.

    IntelliJ IDEA home screen

    Choose Gradle on the left hand side a …

    Read More
  • By Matthew Gilliard
    Transcription live avec Twilio Media Streams, Azure cognitive Services et Java Transcription en direct avec Twilio Media Streams, Azure cognitive Services et Java

    Twilio Media Streams peut être utilisé pour diffuser des données audio en temps réel d'un appel téléphonique vers votre serveur à l'aide de WebSockets. Associé à un système de synthèse vocale, il peut être utilisé pour générer une transcription en temps réel d'un appel téléphonique. Dans ce post, je vais vous montrer comment configurer un serveur Java WebSocket pour gérer les données audio de Twilio Media Streams et utiliser Azure cognitive Services Speech pour la transcription.

    Prérequis

    Pour suivre ce tutoriel, vous devez disposer des éléments suivants :

    Si vous souhaitez passer à l'étape suivante, vous pouvez trouver le code complété dans mon répertoire sur GitHub.

    Mise en route

    Pour qu'un projet Web Java soit rapidement opérationnel, je vous recommande d'utiliser …

    Read More
  • By Diane Phan
    How to Start an HTTP Servlet helper - How to Start an HTTP Servlet

    With so many Java technologies available, it can be difficult to figure out which one to use to power a Java-based web application.

    Beginner Java programmers can benefit from using servlets because they provide an opportunity to understand low-level concepts in Java. Servlets are also great for building interactive web applications and dynamic web pages as they are used to extend apps hosted by web servers. They handle HTTP requests between a browser and any client, database, or application on the HTTP server.

    In this article, you will learn how to build and run your first servlet to host your Java application.

    Tutorial requirements

    Start a new Java project with Gradle

    Gradle is a handy tool that will allow you to build any software on different platforms with high performance. If you use Homebrew, enter the following command to install Gradle: …

    Read More
  • By Diane Phan
    How to Send an SMS with a Click of a Button with Java header - How to Send an SMS with a Click of a Button with Java

    Twilio is all about powering communication and doing it conveniently and fast in any language.

    With the help of Twilio and Java, you can deliver a quick message to someone without having to pick up your mobile device. Using Java also gives you the fun opportunity to create Graphical User Interfaces (GUIs) to complement your user's experience in sending an SMS in a more fun and interactive way.

    In this article, you'll be implementing a small button GUI that will fire an SMS to your mobile phone device once the button is clicked.

    Tutorial requirements

    • A free or paid Twilio account. If you are new to Twilio get your free account now! (If you sign up through this link, Twilio will give you $10 credit when you upgrade.)
    • Some prior knowledge of Java or a willingness to learn.
    • A smartphone with active service to test the project.

    Configuration …

    Read More
  • By Matthew Gilliard
    Group SMS with Twilio and Java Group SMS with Twilio and Java

    Life's complicated enough without having to forward messages between friends and family members to make sure everyone is up to date with what's going on. In this post I'll share how I set up a Twilio number that I gave as "my" phone number to my kids' schools so that all the messages sent to and from that number are automatically forwarded to both me and my wife, and either of us can reply. I expect you can think of situations in your own life where this could be handy: package deliveries, party planning, appointment reminders, the list is long.

    In this post I'll use Java, but the same approach would work in any language which you can build a web app in. If you're comfortable with JavaScript then SMS Forwarding to Multiple Numbers on Code Exchange would be a great starting point.

    What are we building?

    Everything here is …

    Read More
  • By Laxman Eppalagudem
    Dependencies, Confusions, and Solutions: What Did Twilio Do to Solve Dependency Confusion header - Solving Dependency Confusion @ Scale

    Early February 2021, the Product Security team at Twilio came across an article that spoke about a novel supply chain attack based on dependency package naming conventions. The attack consisted of uploading malware to open source repositories such as PyPI, NPM, and RubyGems, and naming them such that they would be downloaded and used by the target company’s application. In this post, we’ll talk about how we at Twilio went about protecting our customers' data from this attack and the various detections and controls we put in place.

    diagram of java code used for twilio private and public registries

    Common questions about dependency confusion

    Since dependency confusion is a novel attack, you probably have some questions about what it is and what’s currently happening. In this section, we’ve gathered some answers about how dependency confusion works, how we’re defending against it at Twilio, and how you can protect your own codebase.

    What’s a dependency?

    Dependencies are code modules packaged for easy …

    Read More
  • By Luís Leão
    Manejo de llamadas telefónicas entrantes con Java y Twilio Manejo de llamadas telefónicas entrantes con Java y Twilio

    Realizar llamadas telefónicas salientes con Java y Twilio solo es la mitad del proceso. Para crear una app de teléfono útil e interesante, tendrá que manejar lo que sucede cuando las personas le devuelven el llamado.

    Para ello, deberá configurar una dirección URL en su consola de Twilio. Las llamadas entrantes activarán las solicitudes HTTP a esa URL y la respuesta a esas webhooksolicitudes determinará qué sucede a continuación en la llamada. Las respuestas HTTP contienen un dialecto XML llamado TwiML, que le ofrece mucha flexibilidad en la forma de manejar la llamada.

    En esta publicación, mostraré cómo configurar un servidor web medianteSpring Boot para manejar las llamadas entrantes con un “Saludos, mundo” hablado y, a continuación, mostraré cómo crear una configuración más interesante e interactiva.

    Si desea saltar al final, revise el proyecto finalizado en GitHub.

    Configuración

    Antes de comenzar, necesitará:

    • Una instalación Java 8 …
    Read More
  • By Luís Leão
    Enviar SMS mediante su app de Spring Boot Enviar SMS mediante su app de Spring Boot

    En este artículo, aprenderá a usar la API de WebSocket con Spring Boot y, al final, podrá crear una aplicación simple de entrega de estados.

    WebSocket es un protocolo de comunicación que permite establecer un canal de comunicación bidireccional entre un servidor y su cliente. La mayoría de los navegadores que se utilizan comúnmente en la actualidad son compatibles con WebSockets.

    Crear una aplicación

    En primer lugar, debe configurar su cuenta de Twilio y un número de teléfono adecuado.

    A continuación, se indican los pasos para generar un proyecto con Spring Initializr:

    1. Vaya a http://start.spring.io/.
    2. Ingrese el valor del artefacto como websocket-callback.
    3. Agregue WebSocket en la sección Dependencies (Dependencias).
    4. Haga clic en Generate …
    Read More
  • By Luís Leão
    Cómo enviar mensajes de WhatsApp desde aplicaciones Java con Twilio Cómo enviar mensajes de WhatsApp desde aplicaciones Java con Twilio

    WhatsApp es un servicio de mensajería global que ayuda a miles de millones de personas a comunicarse entre sí. Las aplicaciones ahora también pueden interactuar de forma programática con las personas en el servicio mediante la API de mensajería de Twilio y la Biblioteca auxiliar Java de Twilio. Veamos cómo enviar mensajes rápidamente a personas desde una aplicación Java nueva o existente.

    Instalación de dependencias

    Nuestro entorno de desarrollo local necesita las siguientes dependencias para enviar mensajes de WhatsApp correctamente desde Java.

    En primer lugar, instale Java en su equipo de desarrollo si aún no lo tiene. También puede leer este tutorial detallado sobre cómo configurar su entorno de desarrollo de Java si tiene problemas.

    A continuación, inicie sesión en su cuenta de Twilio actual o …

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