Learn about the main UI layout of a cool JavaFX game using Scene Builder, TilePane, FlowPane, controller code, iOS and Android settings!
In this three-part series, I’ll show how to use JavaFX for mobile app development: JavaFX looks great and runs on both mobile platforms.
You use the same JavaFX code targeting Google Play and Apple App stores. Performance is excellent and startup time is fast with native images.
You use Java 11+ and the latest JavaFX.
Our game is TiltMaze Labyrinth!
Here on Foojay.io, you can find already a long list of articles about Java on the Raspberry Pi.
As you may know, already I’m a big fan of this combination. The Raspberry Pi on one side is a very cheap computer that allows you to experiment with electronic components thanks to the Pi4J library.
And on the other hand, JavaFX is the ideal framework to build user interfaces that can directly control these components, all in one application!
But maybe you don’t have / want to believe me? So let’s ask two experts what they think is the future of #JavaOnRaspberryPi.
In this article, Almas and Frank show you how to start with an idea for a game and bring it to life in a prototype application. We will then modify the application to run on a Raspberry Pi and on a mobile device.
To give some background, some time ago my 10y old son challenged me to create a Snake-like game with emojis. He selected the emoji images and I “only” needed to do the programming bit, the easy part… Luckily Almas asked me if I had a topic for some pair-programming for his YouTube channel, and his question turned into a three-part series. My son is delighted because his idea is now a real game!
Combined with an inexpensive touch screen, the Raspberry Pi makes for a perfect controller for a machine or game console.
Let’s see how we can use Java and JavaFX to build a test application that also communicates with the pins of the Raspberry Pi to control a LED.
Native Applications for Multiple Devices from a Single JavaFX Project with Gluon Mobile and GitHub Actions
The power of JavaFX combined with the Gluon tools and GitHub actions is amazing. Building and distributing a truly cross-platform application has never been easier!
Really not a single code change is needed to run on different platforms. As you can see from the build processed, the exact same code is used to create native applications for both Windows, Linux, MacOS, iOS, and Android!
Here on foojay.io you can already find two posts by Carl Dea to get you started with JavaFX.
In this post, I want to show you yet another approach that uses the tools provided by Gluon, who are the maintainers, and the driving force behind OpenJFX.
The Gluon start website and the plugin allow you to get started with a new JavaFX project in a few clicks.
Thanks to the amazing work done by the Gluon team this also gives you a quick-start for the creation of a mobile application which can be built for both Android and iOS.