01-21-2022, 06:52 PM
Quote:I would like to know what tools, books I need to learn in order to start developing apps for the PinePhone Pro ?
Hello @ZX Spectrum,
There are four different frameworks you can use to develop mobile Linux apps:
- KDE's Kirigami Framework
- Gnome's libadwaita
- KDE's MAUI Kit
- Google's Flutter
Kirigami Framework
Kirigami is designed to enable you to develop app with convergent user interfaces, meaning you develop the GUI frontend once and your app automatically adjusts itself for mobile and desktop environments. Kirigami apps use QML for the frontend and C++ or, alternatively, Python for their backend.
Like all KDE software, Kirigami is built on top of the Qt 5 framework and will later transition to Qt 6. Qt development greatly focuses on embedded devices, making Qt the best performing framework for mobile Linux app development. Outside of KDE software, Kirigami is used by two third party apps: Subsurface and QPrompt. Disclaimer, I'm the developer behind QPrompt. I chose Kirigami and Qt for QPrompt precisely because a fast performing UI was an absolute requirement for my project.
Use the following resources to get started with Kirigami:
- Kirigami's Documentation https://api.kde.org/frameworks-api/frame.../index.htm
- Other KDE APIs https://api.kde.org/
- KDE's Human Interface Guidelines https://develop.kde.org/hig/
- Introductory talk about Kirigami https://www.qtdesktopdays.com/kirigami-c...rst-class/
- Qt's documentation on QML https://doc.qt.io/qt-5/qmlfirststeps.html
- KDAB's video tutorial series on Qt and QML: https://www.youtube.com/watch?v=JxyTkXLb...707dh9DPRc
- Bryan Carins tutorial series on Qt to learn more about Qt's backend https://www.youtube.com/watch?v=pHc7siV2...3&index=27
Kirigami apps can run on Linux, Android, iOS, Windows, macOS, and other Unix systems. Nevertheless, Android support is minimal and iOS support is basically nonexistent.
KDevelop is a DE that tightly integrates with KDE libraries and frameworks such as Kirigami.
Libdwaita
If you like the simple and elegant designs of Gnome apps, libadwaita is a great option. Libadwaita is Gnome's new move towards convergent apps. It is the successor to the libhandy libraries, which were used to make regular Gnome apps work on mobile Linux environments. Libadwaita apps are built on top of the GTK 4 framework and are developed in C, and there are also bindings for other languages, such as Rust, JavaScript, and Python.
Many Gnome and Elementary OS apps are in the process of transitioning from GTK 3 to GTK 4 and from using libhandy to libadwaita. GTK 3 software is known to have terrible performance, even on hardware accelerated systems. This is why Posh, and mobile Gnome app will perform at a lower frame rate even on the PinePhone Pro. GTK 4 is much faster, nearing the performance of Qt apps on desktop. I have yet to see how effective this performance increase is for mobile applications.
Here are some resources to get started with libadwaita:
- libadwaita's Documentation https://gnome.pages.gitlab.gnome.org/libadwaita/doc/
- Gnome's Human Interface Guidelines https://developer.gnome.org/hig/
- Other Gnome libraries and API's https://developer.gnome.org/documentatio...nents.html
Gnome Builder is a DE that tightly integrates with Gnome libraries and such as libawaita.
Maui Kit
Maui Kit is a UI kit developed by Nitrux as part of the KDE Project. It is built on top of Kirigami focused on building beautiful convergent applications. If offers more tools to create great UIs at the expense of slower startup times and slightly less performance. Maui Kit is not to be confused with Microsoft's MAUI Kit, which is a similar project that came after.
- Website https://mauikit.org/
- All of Kirigami's resources apply to Maui Kit as well
- I failed to find any documentation specific to Maui Kit. You'll probably have to study existing app's source code to develop with Maui.
KDevelop is a DE that tightly integrates with KDE libraries and frameworks such as Maui Kit.
Flutter
Flutter is the GUI toolkit native to Fuchsia OS. It is a cross platform GUI framework designed for mobile apps, that has moved to enable development in the desktop as well. Apps developed in Flutter are written in the Dart programming language. Flutter's performance is comparable to Qt's, although it's in fact slower. Out of the aforementioned frameworks it is the one with least integration with mobile Linux environments. Nevertheless, Flutter apps that make use of a theme that simulates GTK 3 can feel native to a Linux environment. A Linux app developed with Flutter is AppImage Pool.
Flutter apps can run on Linux, Android, iOS, Windows and macOS. Out of all the aforementioned frameworks, it is the best option for cross platform mobile apps, as it tightly integrates with both Android and iOS. For desktop apps that also work on the phone, you should use one of the aforementioned frameworks. Flutter is also your only option for commercial apps where access to advertisement resources is necessary. Nevertheless, as you probably know, ads in apps are not well received in the Linux community.
Here are some resources to get started with Flutter:
- Flutter Documentation https://flutter.dev/learn
- Find third party libraries for your project https://pub.dev/
Quote:I prefer reading books over scavenging from badly written blogs and tutorials
Sorry. There are no books about most of these libraries. With the exception of Qt, GTK, and Kirigami, this is all pretty new. Qt's documentation is amazingly good, Flutter's seems great also. Most others help you understand the frameworks, but you'll have to study other people's open source code in order to make the most from them. This is especially true when it comes to porting your app from Linux to other platforms.
Distributing your app
The best and simplest way to make your app available on most mobile Linux distros is as a Flatpak package distributed through Flathub, because Flatpak support now comes by default in most distros, and Flathub compiles your program for arm64 as well as amd64 architectures.
https://github.com/flathub/flathub/wiki/App-Submission
Follow Gnome Software's guidelines for distribution to prepare your app for distribution, irregardless of the framework it was written in.
https://gitlab.gnome.org/GNOME/gnome-sof...e-metadata