Build a GUI App with Chromium
This page was machine-translated. The Japanese page is the official version.
This guide introduces GUI applications for Actcast through an example browser application using Chromium. A GUI application can display information on a connected monitor and receive input from a mouse or keyboard. You can implement a custom interface or use existing GUI software.
Example application
The sample application displays a URL on a monitor connected to an Actcast device. Example uses include keeping a store dashboard visible or displaying signage.
See the Chromium sample application.
The sample supports:
- Opening a default URL specified in the Act settings at startup.
- Selecting between full-screen window mode and client-area kiosk mode through the Act settings.
- Keyboard and mouse input.
The Act settings used by the sample are:
| Setting | Description |
|---|---|
default_url |
URL to display at startup. |
kiosk_mode |
When true, Chromium displays only the client area in full-screen mode. |
keylayout |
Keyboard layout, expected to be jp or us, when text input is needed. |
Requirements
- Connect a display to the device.
- Connect any keyboard or mouse before starting the Act.
- Ensure the device’s network can reach the URL to display. The connection must not be blocked, for example by a required proxy.
Important
Hot-plugging a keyboard or mouse while the Act is running is not supported. Connect input devices before starting the Act.
Application structure
The sample targets ActcastOS 4 and assumes a Raspberry Pi 4 Model B. The application requires these files:
app/main
app/main.py
app/healthchecker
.actdk/setting.json
.actdk/dependencies.json
manifesto/bookworm.json
setting_schema.jsonWhen testing in Developer Mode, also provide act_settings.json. See the sample project for the complete implementation and setup instructions.
Updating Chromium
Chromium is installed with apt when the application is built, and is included in the built app image. Chromium is not updated on the device while the Act is running. To pick up security fixes for Chromium, rebuild the application, release a new version, and upgrade the Act.
In the sample, Chromium is installed from the Raspberry Pi repository. Security fixes published by Debian may take some days to reach the Raspberry Pi repository.
First, build the release image without the cache.
actdk build --release --cleanWithout --clean, the cache from an earlier build may be used, and the image may keep an older version of Chromium.
Without --release, the image is built on the remote device and the cache on your local machine remains, so use --clean together with --release.
For details, see Building without the cache.
You can check the version of Chromium in the built image with the following command.
In the image name actcast-app-chromium, replace chromium (the app_id of the sample) with the value of app_id in .actdk/setting.json.
Keep chromium after -W, which is the package name.
docker run --rm --pull=never --platform linux/arm64 --entrypoint dpkg-query actcast-app-chromium:raspberrypi-bookworm -W chromiumThe output looks like this:
chromium 1:156.0.8078.108-1~deb12u1+rpt1The part after 1: and before the first - (156.0.8078.108 in this example) is the version of Chromium itself.
From the fixed version in the security advisory (for example, 156.0.8078.108-1~deb12u1 in the Debian security tracker), take the part before the first - as well, and make sure that the version shown is the same as or later than it.
Packages from the Raspberry Pi repository start with 1: and Debian packages do not, so if you compare the whole version strings, even an older Chromium looks newer.
A fix released without changing the version of Chromium itself cannot be identified in this way.
If the version is older than the one in the advisory, do not upload the image.
Wait until the fixed package reaches the Raspberry Pi repository, and then start again from actdk build --release --clean.
Then upload the application with actdk upload (Upload to Actcast) and release a new version (Release an application).
To use the released version, the Act must be upgraded on the devices (Act Upgrade).
If you provide the application to other users, tell them about the new version and ask them to upgrade their Acts.