Build the future of communications.
Start building for free

Java posts

  • 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こちらで公開した記事(英語)を日本語化したものです。



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




    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 domain to the local application running on your computer. …

    Read More
  • By Diane Phan
    How to Organize a Lunch Order with Java and Twilio SMS header - How to Organize a Lunch Order with Java and Twilio SMS

    Offices are opening up again! As employees are slowly going back to work in the office, local businesses are blooming with an influx of customers and new food orders. Allow Twilio to assist you in making your next lunch run with a quick and accessible way to view those elaborate orders on your phone when you're in line.

    In this article, you will learn how to make a list to add and view from your phone using Twilio SMS and Java.


    Read More
  • By Akhil Chawla
    How to Send an SMS With Java and SpringBoot header - How to Send an SMS With Java and SpringBoot

    Twilio is a customer engagement platform providing programmable communication tools for making and receiving phone calls, sending and receiving text messages, and performing other communication functions using its web service APIs. Twilio conveniently empowers communication in any language.

    With the help of the Twilio SMS API, Java, and the Spring Boot framework, you can send SMS with a text message. This article will help you set up a Spring Boot application that will expose a REST API to send the SMS. You will also be using the Twilio Java Helper Library.

    In this article, you will learn how to navigate a Java IDE to set up and build a Spring Boot application and send an SMS to your mobile device. Find the code for the article on GitHub.

    Tutorial Requirements

    Read More
  • By Felistas Ngumi
    How to Send a WhatsApp Message in 30 Seconds Using Java and Gradle header - How to Send a WhatsApp Message in 30 Seconds Using Java and Gradle

    Approximately Two billion people across the globe use WhatsApp as a communication medium. It is fast and a convenient app to use as it does not only provide peer to peer messaging, but it is also used by companies and entrepreneurs to run their businesses through WhatAapp business. Over the years, WhatsApp has proven to be an important tool to engage with customers as at least more than 58% of its users use it more than once in a day.

    The Twilio WhatsApp Business API is handy and secure and enables you to accomplish a number of tasks including sending and receiving media files, sharing map locations and driving engagement with your users. It is a great enabler for businesses worldwide. So, why not scale your business and leverage tools that have proven to work over time?

    In this tutorial, I will take you through how to send a …

    Read More
  • By David Mbochi
    How to Write Custom Queries Using JdbcTemplate In Spring Boot header - How to Write Custom Queries Using JdbcTemplate In Spring Boot

    When developing applications it is crucial for a developer to understand the abstractions behind the libraries that are used in the application. This will help the developer understand the code better and assist them in writing efficient applications.

    In this tutorial, you will learn how to write custom queries using JdbcTemplate which is a wrapper class for writing row JDBC queries. There are other implementations that are much more convenient than JdbcTemplate such as Hibernate and the Java Persistence API (JPA) because these API’s hide the actual implementations from the developer and only expose the necessary details such as the methods to insert, update and delete records from your database.

    When you decide to use JdbcTemplate as opposed to Hibernate and the Java Persistence API you are prone to have boilerplate code in your application. The benefit of using JdbcTemplate is that it provides low level access to your queries …

    Read More
  • By Pooja Srinath
    Spring BootアプリケーションでSMSを送信する方法 Spring BootアプリケーションでSMSを送信する方法

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

    本稿では、Spring BootでWebSocket APIを使用し、シンプルなSMS送信アプリケーションを構築する方法について説明します。






    TwilioコンソールのBuy a Numberにアクセスします。






    Spring In …

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