Qt for Android better than ever before
kdab.com
kdab.com
This update looks really neat, and may solve some problems for some people. But personally my biggest gripe with Qt is qmake.
When you are doing Android, lots of resources assume Gradle, and lots of Qt stuff assumes qmake. Neither is ideal if you're dealing with other libraries like gstreamer, or even worse: proprietary libraries compiled using an old NDK.
So I ended up writing my whole build system in cmake, which made builds on Windows and Linux a lot saner, but made Android a living hell. I'd love to see better support in Qt for actual sane build systems you can use with real world third-party libraries, because qmake is not it in my experience.
The tooling for Qt needs help, I feel like this is a huge reason why shovelware Electron apps are so common now.
Edit: Capitalization
I think the pain is unfairly attributed to Qt. A lot of the pain actually comes from the poor tooling in the C++ world.
Conan is supposed to come to the rescue, but after attempting to use it, it feels like it's still not as easy to use as any other package manager (npm, pypi, gems, etc). I love C++ and Qt, but It's extremely difficult to convince people to start any new projects in C++.
Common C/C++ questions and answers in stack overflow: how do I do x in C++ (e.g. trim whitespace), the usual responses: 1. It's trivial to implement, do it yourself. 2. Why would you want to do that.
Compare that to pulling up a library to do that, or it's already baked into the standard library (e.g. Java).
That being said, my SO would love you! He is always trying to get me to write things in C :D
std::string is laughably underpowered in comparison - it's basically a vector of bytes, missing a huge amount of convenience methods and all Unicode support.
The XCode cross-compile is incredibly smooth, and the runtime is complete ass. Qt really messed up high-DPI support and it has no better example of this than iOS.
It started, but then it crashed. So I gave up on that, and let someone compile it directly on Windows. Then there are no issues.
I did not try Android there.
Then I have another app that runs on Linux, Windows and Android using FreePascal/Lazarus rather than Qt.
FreePascal is really great for building. You only need to set the search path, and then it finds all the files it needs (just sometimes it crashes when serializing the dependency graph, then you need to delete all object files and restart).
Cross compiling from Linux to Windows works perfectly. FreePascal has an internal linker, so you do not need any other software for Windows. You do not need to deal with proprietary libraries, because there basically are no FreePascal libraries, especially no proprietary.
Linux-Linux cross compilation is more complicated. I just got a new computer and my 32-bit build failed silently because I did not have 32-bit gtk dev files and crtbegin from gcc installed. Yesterday I tried to install them with apt, but the installation failed, because they were conflicting with the 64-bit gtk dev gir files. Then I set force override in apt, and the installation worked, and then FreePascal cross compiled correctly. However, today I noticed, apt had uninstalled Python, Mercurial, Tortoise-Hg and most TeXlive packages. There must be something very wrong with Ubuntu's multiarch support.
There are three ways to run a Lazarus GUI on Android. First LAMW which has created a lot of FreePascal JNI wrappers around Android Views (and is far too complex for my liking); secondly Lazarus Customdrawn which draws all controls directly in FreePascal (and looks like it was designed to be Windows 98 compatible and crashed) and thirdly Qt, because Lazarus supports Qt as GUI backend (which probably works on Desktop, but I do not know anyone using it on Android). Hence, I compile my app as .so, export the data through JNI, and wrote a completely new GUI in Android Studio without using anything of Lazarus. Gradle does not need to know anything about FreePascal, it just copies the .so to the apk. But theoretically Lazarus is all you need. (Then I tried to submit my app to F-Droid, but they cannot include FreePascal/Lazarus apps, too complex build process)
Does mean you have a platform specific build system though.
One fork of Pyre does this using a web view, and it fixes the media scaling bug, but what is the advantage over Signal Desktop at that point (besides being a tray icon & having native integration)?
Edit: Capitalization
It's all complete dog. Looks terrible, behaves worse. It's like Flutter except with 1/100th of the developer firepower to make sure it behaves natively.
My personal favorite is the input controls. They haven't freaking implemented copy and paste! It is all just beyond unusable.
What are you talking about? Qt Widgets and Qt Quick Controls (QML) have always supported copy and paste.
Qt is amazing and so is QML. I still found QML JavaScript engine utilizing a lot of memory back then as well and I don't know if it has been fine-tuned these days.
Also QML will gain type checking.
TL;DR : "we’re aiming to have Qt 6.0 ready for a first release by the end of 2020."
I think I finally understand why everyone keeps saying that Qt on Android "isn't ready for prime time."
I have yet to use electron tho... I haven't done a personal project in a long time to play with it.
Source: https://www.qt.io/faq/
Using the LGPL licensed Qt on Android looks difficult. Although, I suppose compliance would not be much work in comparison to the development of a significant app.
Has anyone else had to go through compliance with the above? How did you do it?
https://www.qt.io/start-up-plan/
I thought there was a small business license available for a one-time fee of $100, but now I only see recurring subscription options.
> The requested URL /pyqt-tutorial was not found on this server
That's the only way to legally distribute Qt apps through Apple's app store.
It doesn't need to be available via the same mechanism, it just needs to be available, no? And if so, you could embed within the .apk (even if it makes it huge), no?
you haven't seen QML :-)
http://qmlbook.github.io/ch04-qmlstart/qmlstart.html#qml-syn...
https://en.wikipedia.org/wiki/JavaFX
OpenJDK is now the 'official' JDK and reference implementation with Oracle making proprietary forks for their own customers, supported on their own timelines.
Java is actually doing some really interesting things since Java 9, with modular runtimes, pluggable garbage collectors, new compilers (Graal) and the Clojure crowd are being swept along with it simply by stint of being on the JVM.
- https://doc.qt.io/qt-5/android.html
> Qt for Android enables you to run Qt 5 applications on devices with Android v4.1 (API level 16) or later.
> One framework. One codebase. Any platform.
I had troubles accessing external storage (the SD-card), and ended up writing quite some ifdefs to fix that. Probably the kdab folks have proper solutions to most common issues, but at the end of the day the idioms between desktop apps and mobile apps are quite different, and you will end up wasting time to fix those issues if you really believe in having a single code base for cross-platform apps.
So I ended up keeping the logic in C++ with native views.
Felgo sells Qt components etc (no experience with them), they have a showcase: https://felgo.com/showcases
Now I wonder if someone has made a big scan of apps from Play store analyzing what toolkits they use.
If you had a negative experience with Qt for Android, go ahead and share it.