Build the future of communications.
Start Building for Free

Java posts

  • By Peter Aideloje
    Build a Phone Number Verification System with Java Spring Boot and Twilio Verify header - Build a Phone Number Verification System with Java Spring Boot and Twilio Verify

    The benefit of having a phone number verification system in today’s business environment cannot be overemphasized as it helps to fight fake account fraud through the delivery of a time-based one time password code. This TOTP provides a good level of security to a user in a user-friendly approach.

    The Twilio Verify API provides an additional level of account security through sign-up protection and throughout the user’s journey. Therefore, businesses everywhere rely on it as a way of authenticating users and proving that a phone number is valid, accessible and still functional.

    This tutorial will focus on building a phone number verification system using the Spring Boot framework and the Twilio Verify APIto verify a user’s phone number.

    You can also visit the Twilio official documentation to learn more about other available Twilio APIs and systems that are supported.

    Tutorial requirements

    To follow along with this tutorial, you’ll need …

    Read More
  • By Diane Phan
    How to Send Scheduled SMS with Twilio header - How to Send Scheduled SMS with Twilio

    Twilio is all about powering communication – and doing it conveniently and fast. Our Programmable Messaging service has been available for a long time, but until now, scheduling a message to be sent at a future time required a developer to use their own scheduling solution.

    Fortunately, this is now a thing of the past! With Message Scheduling, you can send your scheduled SMS and MMS messages with a single API call, without using custom schedulers.

    In this tutorial, you’ll learn how to send scheduled SMS notifications in Java.

    Tutorial requirements

    Read More
  • By Ehis Edemakhiota
    How to Build an Object Recognition App With Google Cloud Vision API, Java Spring Boot, and Twilio WhatsApp header - How to Build an Object Recognition App With Google Cloud Vision API, Java Spring Boot, and Twilio WhatsApp

    Our world today can be described as smart. Smart houses, smartwatches, smartphones, smart cars and even smart foods 😜 is the talk of the day. These smart devices are made possible majorly due to advancements in the field of computer vision. This consists of object and text recognition, which opens doors for unimaginable technology that will certainly influence how humans live and learn in the coming times.

    The Google Cloud Vision API gives access to powerful pre-trained machine learning models that can be employed via easy-to-use REST APIs. It promises to be an exciting project that you will be proud to show to your friends after you complete it.

    This article provides insight into integrating object and text recognition features into your Java Spring Boot application. In the tutorial, you will learn how to use the Google Cloud Vision API to create a cool app that can analyse images …

    Read More
  • By Diane Phan
    How to Create an Engaging Scavenger Hunt with Twilio header - How to Create an Engaging Scavenger Hunt with Twilio

    As kids are finishing up school and the days are becoming warmer, consider getting everyone active by sending them on a scavenger hunt around the neighborhood. To make the day more exciting, utilize some Twilio magic by having the participants use their phones to complete puzzles to determine the winner of the scavenger hunt.

    This tutorial is intended to present an idea that can be appended to the end of the scavenger hunt game, sort of like an alternate reality game (ARG) that utilizes both the real world and technology.

    The flow of the game goes as follows:

    • The user will text the Twilio number to retrieve the URL to play a minigame.
    • The user will play a click-based game that will trigger an SMS to be sent to the host of the scavenger hunt, likely yourself, signifying that someone has completed the scavenger hunt.

    In this article, you will …

    Read More
  • By Vivek Kumar Maskara
    How to Use the Twilio Java Helper Library and AWS CDK to Deploy AWS Lambda Functions header - How to Use the Twilio Java Helper Library and AWS CDK to Deploy AWS Lambda Functions

    In this post, learn how to leverage the AWS Cloud Development Kit (CDK) to build and deploy a serverless AWS Lambda function that uses Twilio’s Programmable SMS API to send SMS to users. We will use Java for all components of this post to define the AWS CDK application and AWS Lambda Handler, and we will use Twilio’s Java Helper Library to work with the SMS APIs.

    Prerequisites

    For this tutorial, you will need to set up Java on your system, since we will be using it to define our AWS CDK application and the AWS Lambda handler. In addition to it, you will need to install AWS CLI and AWS CDK CLI, to configure AWS credentials and to build your CDK application respectively. Finally, you will need to create an AWS account for deploying the application, and a Twilio account with an SMS-enabled phone number to send SMS. Refer …

    Read More
  • By Diane Phan
    How to Make a Clicker Game with Java header - how to make a clicker game with java

    Making mini browser games can be a great way to learn how to code and understand how the internet works. It's also fun to just make your own version of pointless and addicting games such as Cookie Clicker.

    In this article, you will learn how to make your own clicker game that runs on the Java Spring Boot application. The objective of the clicker game is to count the amount of clicks on a chosen image. In this particular example, we will allow the user to click on an image of a cat to give it some treats.

    Tutorial requirements

    Add the Thymeleaf dependency

    Navigate to the pom.xml file to add the following dependency to …

    Read More
  • By Matthew Setter
    Javaで環境変数を設定する方法 Javaで環境変数を設定する方法

    この記事はMatthew Setterこちらで公開した記事(英語)を日本語化したものです。

    環境変数は、データベースやキャッシュサーバー、サードパーティーのAPIなど、コードに明示的に設定を保存することなくJavaアプリケーションを構成するための優れた方法です。

    このような設定をコードの外に保管しておくことには、いくつかの利点があります。

    • 設定変更時のコードの更新や再コンパイルが不要になります。
    • ユーザー名やパスワード、デプロイメントトークンなどの機密情報の漏洩を防止します。
    • 同じコードを複数の環境にデプロイできます。

    本稿では、Javaで環境変数を扱う方法をご紹介します。

    Javaで環境変数にアクセスする方法

    最も一般的な方法は、System.getenv()を使う方法です。System.getenv()は任意の引数として、Stringを受け取ります。引数が渡されたかどうかによって、このメソッドから返される値が異なります。

    Stringが渡され、内部環境のMapのキーと一致する場合、そのキーに対応する値が返されます。 一致するキーがなければ、nullが返されます。引数が渡されない場合、すべての環境変数とその値を含む読み出し専用のjava.util.Mapが返されます。Mapのキーは環境変数名で、値は環境変数の値です。

    UNIX、Linux、macOSでは、環境変数は大文字と小文字を区別しますが、Microsoft Windowsでは、大文字と小文字を区別しません。

    以下に、このメソッドを使って、ユーザーのシェルを含むLinu …

    Read More
  • By Matthew Setter
    Umgebungsvariablen in Java verwenden Arbeiten mit Umgebungsvariablen in Java

    Umgebungsvariablen sind eine hervorragende Möglichkeit, Java-Anwendungen zu konfigurieren, ohne Einstellungen explizit in Code speichern zu müssen, z. B. für Datenbank- und Caching-Server oder für APIs von Drittanbietern.

    Solche Einstellungen außerhalb des Codes vorzunehmen hat mehrere eindeutige Vorteile:

    • Bei Änderungen der Einstellungen muss der Code nicht aktualisiert und erneut kompiliert werden.
    • Die Offenlegung sensibler Anmeldeinformationen wie Benutzernamen und Passwörter sowie von Tokens wird verhindert.
    • Derselbe Code kann in mehreren Umgebungen bereitgestellt werden.

    In diesem kurzen Artikel werde ich Ihnen einige der Möglichkeiten zeigen, wie Sie mit Umgebungsvariablen in Java arbeiten können.

    Zugriff auf Umgebungsvariablen in Java

    Eine der häufigsten Methoden ist die Verwendung von System.getenv(), die ein optionales Argument des Typs String akzeptiert. Je nachdem, ob ein Argument des Typs Stringübergeben wird, werden unterschiedliche Werte von der Methode zurückgegeben. Genauer:

    Wenn ein String übergeben wird und er mit einem Schlüssel in der Map der internen Umgebung übereinstimmt, wird dessen …

    Read More
  • By Diane Phan
    Get to Know Java SDKs and Libraries Copy of TwilioQuest  Blog Headers  1200X628 (1).png

    This post is a part of a series that supports an expanded adventure, as of May 2022, in TwilioQuest, but it will be relevant to anyone curious about Java Libraries. Happy reading!

    Ahoy, operator. Congratulations on gaining acceptance into the Arcane Academy of API Arts. I’m Professor Taifa Omar Warsame, head of House Turing. In House Turing, we believe that code is for people. If code isn’t human centered - if it’s not helping people have fun, work smarter, or live better, it’s not that interesting. That’s why, in House Turing, we love SDKs and helper libraries. They help make working with APIs easier and more readable for the humans behind the code.

    For creatives such as myself, writing code can be a form of art and expression. It's another medium to bring ideas to life, whether it be a data visualization or small click based game …

    Read More
  • By Diane Phan
    How to Set Up and Deploy a Java Spring Boot Application header - How to Set Up and Deploy a Java Spring Boot Application

    It might seem intimidating to build projects using Java especially when it seems confusing to know how to start and set up. Fortunately, using the Spring Boot and ngrok tools will reassure you that writing code for Java applications can be fast and seamless.

    Spring Boot reduces the problem of figuring out how to structure the project hierarchy and provides sufficient documentation for developers to create standalone applications without relying on external web servers.

    Many articles on the Twilio blog utilize ngrok, a localhost tunneling tool that exposes webhooks on public URLs that can be reached by Twilio. The excellent ngrok tool is also used to generate temporary public URLs for your development web server.

    In this article, you will learn how to set up a Java Spring Boot application and create a tunnel from a URL on the ngrok.io domain to the local application running on your computer. …

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