FireMonkey for Linux

From RAD Studio
Jump to: navigation, search

What is FMX for Linux?

FireMonkey for Linux, also known as FMXLinux, is an add-on component provided to Delphi and RAD Studio Enterprise and Architect edition customers via an exclusive OEM agreement with FMXLinux. FMXLinux provides capabilities for building GUI applications for Linux, extending RAD Studio’s (Delphi Edition) FireMonkey cross-platform framework.

Starting with 10.3.1, the FireMonkey for Linux (FMX) client add-on is available for Delphi and RAD Studio Enterprise customers that are current on Update Subscription via the RAD Studio GetIt Package Manager in the IDE.

Key features:

  • FireMonkey for Linux provides the ability to create GUI applications for Linux, extending Delphi’s FireMonkey cross-platform framework.
  • FMXLinux expands Delphi’s support from server applications to FMX client applications for popular Linux distributions.
  • Includes several ready-to-use user interface styles.
  • Many of the FMX components, such as grids, widgets, etc. work seamlessly on Linux clients.
  • Leverage RAD Studio’s innovative features, such as Live Bindings, and much more, in your Linux client applications.
  • Leverage WebKitGTK support to run an FMXLinux application as an HTML5 web application in the browser.

How to access FMX for Linux

To download and install FMXLinux, open Delphi, go to Tools > GetIt Package Manager, and search for fmxlinux. At the end of the process, you need to restart the IDE, as requested by the GetIt package manager.

FMXLinux01.png

FireMonkey GUI Application Prerequisites

Installing Linux Platform Support

Before installing FMXLinux, you need to have Linux platform support for Delphi installed. Go to Tools > Manage Platforms to verify that Delphi Linux 64-bit is installed.

FMXLinux02.png

Installing and running PAServer

After installing Linux platform support, you need to install the Platform Assistant on Linux to build and deploy Linux applications. PAServer enables you to use the Deployment Manager, import the Linux SDK, and perform remote debugging on a Linux system. After installing PAServer for Linux, you will need to run PAServer before you can start building FMX Linux GUI applications.

Installing dependencies on your Linux server

To use graphical features in your server application, you will need to install some dependencies. You don't need to install the whole X11 system on your server.

To install dependencies on Ubuntu/Debian, type this into the terminal:

sudo apt install libgl1-mesa-glx libglu1-mesa libgtk-3-common libgstreamer1.0 libgstreamer-plugins-base1.0

Getting Started

FMXLinux Configuration

When installing FMXLinux via GetIt, the system registers a DLL Expert (which adds the “Add Linux Platform”) menu indicated below and also adds the catalog repository library folder to the Library Path for the Linux platform. You can verify this in Tools > Options > Language > Delphi Options > Library and choose Linux 64-bit from the Selected Platform combo box at the top:

FMXLinuxLibrary.png

Click the ellipsis Ellipsis ide.png to expand the list of paths and eventually fine tune them.

Building and deploying your first project

After installing the prerequisites listed above and FMXLinux via the GetIt Package Manager, go to File > Open Project to open an existing FireMonkey Project or File > New > Multi-Device Application to create a new FireMonkey project.

Next, right-click on the project in the Project Group to Add Linux platform.

FMXLinux03.png

Once you’ve added the Linux platform to your project, you will be able to switch to Linux 64-bit and deploy your FMX GUI applications to Linux. Ensure that PAServer is running on your target Linux machine. Click Run to deploy your Linux GUI application.

FMXLinux04.png

Attention: When building an FMXLinux application, you might get an error message saying System.Devices is not supported on this platform.

Error message.png

This happens because your library paths are not properly configured and instead of building against the proper DCU file, the compiler looks for the original version of the source code file, which is not compatible (FMXLinux patches that file).

Additional Capabilities

Web Deployment to Ubuntu Server

You can use the GTK-Broadway backend to run an FMXLinux application as an HTML5 web application in the browser:

  1. Install Required Libs: sudo apt install xorg libgl1-mesa-dev libosmesa-dev libgtk-3-bin
  2. Start broadway server: broadwayd
  3. Run application from IDE
  4. Load :8080 in the browser

Supported Linux Distributions

Delphi Linux supports RedHat Enterprise and Ubuntu distributions, see the list of Supported Target Platforms for more information.

Additional Resources

There are a number of videos that you can view for help with getting started building FMX Linux applications:

See Also