9 ms·
Qt for Android better than ever before
- allenskd 7y agoI don't know how Qt & Android fare these days... I know it was quite a hassle to create background services when I first tried to get into it and there was no definitive answer as I think it was still on the roadmap to add it (perhaps?). 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.
- kuschku 7y agoEven with native Java/Kotlin on Android it's pretty hard to reliably run background service, if not to say impossible (most manufacturers make it impossible, and even on Google devices it's impossible on Marshmallow).
- oever 7y agoQt6 will have faster and lower footprint QML because JavaScript will be optional. Also QML will gain type checking.
- dkersten 7y agoIs there a timeline or target release date for Qt6 yet?
- cjslep 7y agoI had to create a Qt JNI app... That was entirely run as a background service. It was quite the wizardry, and did require a little bit of Cyanogen kernel hacking from a coworker.
- yellow_lead 7y agoIf you want a background service you currently have to create the code for it in Java, and call that code with the JNI. You can register callbacks for communicating the other direction (towards native code). A pain, but possible.
- wtracy 7y ago> I know it was quite a hassle to create background services I think I finally understand why everyone keeps saying that Qt on Android "isn't ready for prime time."
- The_rationalist 7y agoCould you do a comparison of why using QT js instead of electron/ionic?
- allenskd 7y agoIt's not a comparison I can do. I haven't used ionic extensively enough to put out a well-thought out comparison that can expose the layers of complexities and the pros and cons of how we can benefit from each technology. I have yet to use electron tho... I haven't done a personal project in a long time to play with it.
- benmcnelly 7y agoThat is great, love it how sometimes things like this are stumbled upon by working outside what you are used to.
- tipsysquid 7y agoI've been getting more and more interested with qt development. As a linux user, I'm exhausted from the bloat and cycle stealing electron apps ( with VSCode being a notable exception to this rule). But more recently, the idea of writing one app in Qt, running it everywhere between Android, a Librem 5, and desktop platfoms is really exciting.
- mehhh 7y agoThat was the main idea behind Pyre-Qt, but dynamic media resizing is not well supported in Qt unless you pull in a web view (at which point you've recreated Electron). https://pyre.chat https://pyre.chat 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
- panpanna 7y agoWhat about qml?
- Kenji 7y agoWhy not GTK? You have even less bloat than in qt.
- Gibbon1 7y agoWhen I was looking for a new editor, out and out excluded anything that didn't use either Qt or WxWidgets. What I saw was both frameworks allow you to at least support Linux, BSD, OSX, and Windows without too much hassle. It's been a while but my impression was Qt applications look like Qt applications and WxWidgets look more like native-ish applications. (But could probably am wrong).
- neogodless 7y agoFor those new to hearing about Qt / Qt for Android: - https://doc.qt.io/qt-5/android.html https://doc.qt.io/qt-5/android.html - https://www.qt.io/ https://www.qt.io/ > 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.
- satysin 7y agoQt for Android has always looked pretty good but I never see it used. Could someone link a few real-world apps developed with Qt for Android?
- Ididntdothis 7y agoSame here. Would like to see some real world apps and ideally also the code.
- p7IDD243 7y agoThis is an app I've been using written in Qt/QML that works on desktop and mobile, it doesn't seem like there's a whole lot of differences to make it work on mobile: https://github.com/alamminsalo/orion https://github.com/alamminsalo/orion
- stabbles 7y agoNot really a real-world app, but a simple QtQuick with Qt3d app worked pretty well. When it comes to app sizes, a vanilla Qt app produces an apk file of ~15MB, which is reasonable. 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.
- distances 7y agoI had a Qt app for MeeGo and Symbian, and later ported and released it to Android too. I didn't like the use experience, so I rewrote in native Android some five years ago or so. Code was fine, but the UI was a lot of work and still felt a bit out of place.
- pjmlp 7y agoThat was my experience back in Qt 5.4 (so a while ago). So I ended up keeping the logic in C++ with native views.
- 7y ago
- pepijndevos 7y agoI have in the past developed a fairly large (proprietary) Qt application that used the same codebase on Linux, Windows, and Android. I would say Windows and Android are tied for compile hell. 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.
- scrollaway 7y agoI read somewhere a few months back that qt is dropping qmake in favour of cmake in the medium term. And everyone rejoiced.
- detaro 7y agobuilding Qt apps with CMake is already possible and supported. Building Qt itself with CMake is an active project, and the long-term plan is indeed to drop qmake completely.
- amelius 7y agoThat's a step in the right direction. The next thing would be to drop the compiler extensions (signal/slots macros) in favor of modern C++.
- kevin_thibedeau 7y agoAlready done by CopperSpice.
- jimbo1qaz 7y agoVerdigris is a moc replacement (not a Qt fork like CopperSpice) which generates QMetaObject through macros using constexpr.
- krn 7y agoWhat are the technical reasons to prefer Qt over JavaFX[1]? Even Bitwig Studio, which is a C++ audio application, went with JavaFX for its cross-platform UI. It can also be written in React-like declarative style[2], which is much easier to maintain. [1] https://openjfx.io/ https://openjfx.io/ [2] https://github.com/cljfx/cljfx https://github.com/cljfx/cljfx
- yoz-y 7y agoYou can write in C++ so it's much easier to re-use libraries in C/C++.
- The_rationalist 7y agoElectron does allow to use c++, what make QT c++ more practical for business logic?
- ahartmetz 7y agoThe things that are missing in standard C++: Unicode, SQL, filesystem (kind of fixed in C++20 or so), serialization, network protocols, JSON, XML, an event loop(!), signals and slots, a thread pool, compiled-in resources, runtime plugin support, etc
- The_rationalist 7y agoThanks for exemplifying! Nit: filesystem is fixed in C++17.
- yoz-y 7y agoI’d add that passing objects is also way easier when you do not need to bridge languages. And you avoid gyp.
- Cyph0n 7y agoAlong the lines of [2], there is also ScalaFX: https://github.com/scalafx/scalafx https://github.com/scalafx/scalafx
- mherrmann 7y agoFor people new to Qt: It's a cross-platform GUI framework. It's written in C++ but can also be used from (among others) Python. If you're interested in examples, see for instance https://build-system.fman.io/pyqt-tutorial https://build-system.fman.io/pyqt-tutorial (I'm the author).
- quietbritishjim 7y ago> Not Found > The requested URL /pyqt-tutorial was not found on this server
- superpermutat0r 7y agohttps://build-system.fman.io/pyqt5-tutorial https://build-system.fman.io/pyqt5-tutorial 5 missing
- allset_ 7y agoYour link is broken.
- vips7L 7y agoIs there anything like this for JS?
- cocochanel 7y agoNo it's not.
- MaxBarraclough 7y agoYou're being downvoted for making a contrarian comment with no substance. If you had a negative experience with Qt for Android, go ahead and share it.
- Gibbon1 7y agoNow there are three comments with no substance.
- mangosherbet 7y agoQt is a great toolkit and I've messed around with it on Android on and off since Lighthouse. One thing I want to point out is that Qt is LGPLv3 and (in my non-lawyer opinion) this is a pain point on restricted application environments like the Google Play store on Android. Its not clear to me that you can comply with a user request to get access to replace or modify LGPL'd software in your application.
- wtracy 7y agoThat issue goes away if you purchase a commercial license, which is quite affordable. That's the only way to legally distribute Qt apps through Apple's app store.
- joezydeco 7y agoThankfully it's a one-shot license for "mobile" development as opposed to "embedded" development, which needs a paid license per unit.
- cat199 7y ago> Its not clear to me that you can comply with a user request to get access to replace or modify LGPL'd software in your application. 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?
- dTal 7y agoI've been looking for a way to write cross-platform apps without a painful language or build hell, and I've just come across EQL5-Android, which binds Qt for Android with Embeddable Common Lisp. I don't know Common Lisp, but I like Scheme and I'll try anything to avoid Java or C++. So far it's looking very slick... https://gitlab.com/eql/EQL5-Android https://gitlab.com/eql/EQL5-Android
- zem 7y agowhen i saw the article my first thought was to wonder whether eql was still alive. nice to know that it is!
- akavel 7y agoYou may be also interested in my hobby project, a WIP tool for writing Android apps in Nim, completely without Java and/or Android Studio: https://forum.nim-lang.org/t/4840 https://forum.nim-lang.org/t/4840. I'm slowly pushing it further since the initial PoC announcement above, but it's not yet there for a second phase of loud publicity. Still, you may like to watch for releases on GitHub. As you can see from this project, I'm also desperate to avoid Java or C++... ;)
- HappySweeney 7y agoDart+Flutter can do cross-platform desktop, web, android and ios.
- baybal2 7y agoI'm very disappointed that native GTK+ on Android went nowhere
- Buttons840 7y ago> The user of your application has to be able to re-link your application against a different or modified version of the Qt library. With LGPLv3 it is also explicitly stated that the user needs to be able to run the re-linked binary on it’s intended target device. It is your obligation to provide the user with all necessary tools to enable this process. For embedded devices, this includes making the full toolchain used to compile the library available to users. For parts licensed under LGPLv3 you are obliged to provide full instructions on how to install the modified library on the target device (this is not clearly stated with LGPLv2.1, although running the application against the modified version of the library clearly is the stated intention of the license). Source: https://www.qt.io/faq/ 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?
- wtracy 7y agoTypically you get a commercial license for mobile development. That's the only way to distribute Qt apps through Apple's store. https://www.qt.io/start-up-plan/ 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.
- stefan_ 7y agoIf you were to make a list, building the damn thing would probably come last. Go to the store on your favorite platform, search "The Qt Company" and try some of their demo apps. 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.
- mkl 7y ago> 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.
- app4soft 7y agoIs there Qt-app template in Material style for Android in source form?