Trusted Software Excellence across Desktop and Embedded
Take a glance at the areas of expertise where KDAB excels ranging from swift troubleshooting, ongoing consulting and training to multi-year, large-scale software development projects.
Find out why customers from innovative industries rely on our extensive expertise, including Medical, Biotech, Science, Renewable Energy, Transportation, Mobility, Aviation, Automation, Electronics, Agriculture and Defense.
High-quality Embedded Engineering across the Stack
To successfully develop an embedded device that meets your expectations regarding quality, budget and time to market, all parts of the project need to fit perfectly together.
Learn more about KDAB's expertise in embedded software development.
Where the capabilities of modern mobile devices or web browsers fall short, KDAB engineers help you expertly architect and build high-functioning desktop and workstation applications.
Extensible, Safety-compliant Software for the Medical Sector
Create intelligent, patient-focused medical software and devices and stay ahead with technology that adapts to your needs.
KDAB offers you expertise in developing a broad spectrum of clinical and home-healthcare devices, including but not limited to, internal imaging systems, robotic surgery devices, ventilators and non-invasive monitoring systems.
Building digital dashboards and cockpits with fluid animations and gesture-controlled touchscreens is a big challenge.
In over two decades of developing intricate UI solutions for cars, trucks, tractors, scooters, ships, airplanes and more, the KDAB team has gained market leading expertise in this realm.
Build on Advanced Expertise when creating Modern UIs
KDAB assists you in the creation of user-friendly interfaces designed specifically for industrial process control, manufacturing, and fabrication.
Our specialties encompass the custom design and development of HMIs, enabling product accessibility from embedded systems, remote desktops, and mobile devices on the move.
Legacy software is a growing but often ignored problem across all industries. KDAB helps you elevate your aging code base to meet the dynamic needs of the future.
Whether you want to migrate from an old to a modern GUI toolkit, update to a more recent version, or modernize your code base, you can rely on over 25 years of modernization experience.
KDAB offers a wide range of services to address your software needs including consulting, development, workshops and training tailored to your requirements.
Our expertise spans cross-platform desktop, embedded and 3D application development, using the proven technologies for the job.
When working with KDAB, the first-ever Qt consultancy, you benefit from a deep understanding of Qt internals, that allows us to provide effective solutions, irrespective of the depth or scale of your Qt project.
Qt Services include developing applications, building runtimes, mixing native and web technologies, solving performance issues, and porting problems.
KDAB helps create commercial, scientific or industrial desktop applications from scratch, or update its code or framework to benefit from modern features.
Discover clean, efficient solutions that precisely meet your requirements.
Boost your team's programming skills with in-depth, constantly updated, hands-on training courses delivered by active software engineers who love to teach and share their knowledge.
Our courses cover Modern C++, Qt/QML, Rust, 3D programming, Debugging, Profiling and more.
The collective expertise of KDAB's engineering team is at your disposal to help you choose the software stack for your project or master domain-specific challenges.
Our particular focus is on software technologies you use for cross-platform applications or for embedded devices.
Since 1999, KDAB has been the largest independent Qt consultancy worldwide and today is a Qt Platinum partner. Our experts can help you with any aspect of software development with Qt and QML.
KDAB specializes in Modern C++ development, with a focus on desktop applications, GUI, embedded software, and operating systems.
Our experts are industry-recognized contributors and trainers, leveraging C++'s power and relevance across these domains to deliver high-quality software solutions.
KDAB can guide you incorporating Rust into your project, from as overlapping element to your existing C++ codebase to a complete replacement of your legacy code.
Unique Expertise for Desktop and Embedded Platforms
Whether you are using Linux, Windows, MacOS, Android, iOS or real-time OS, KDAB helps you create performance optimized applications on your preferred platform.
If you are planning to create projects with Slint, a lightweight alternative to standard GUI frameworks especially on low-end hardware, you can rely on the expertise of KDAB being one of the earliest adopters and official service partner of Slint.
KDAB has deep expertise in embedded systems, which coupled with Flutter proficiency, allows us to provide comprehensive support throughout the software development lifecycle.
Our engineers are constantly contributing to the Flutter ecosystem, for example by developing flutter-pi, one of the most used embedders.
KDAB invests significant time in exploring new software technologies to maintain its position as software authority. Benefit from this research and incorporate it eventually into your own project.
Start here to browse infos on the KDAB website(s) and take advantage of useful developer resources like blogs, publications and videos about Qt, C++, Rust, 3D technologies like OpenGL and Vulkan, the KDAB developer tools and more.
The KDAB Youtube channel has become a go-to source for developers looking for high-quality tutorial and information material around software development with Qt/QML, C++, Rust and other technologies.
Click to navigate the all KDAB videos directly on this website.
In over 25 years KDAB has served hundreds of customers from various industries, many of them having become long-term customers who value our unique expertise and dedication.
Learn more about KDAB as a company, understand why we are considered a trusted partner by many and explore project examples in which we have proven to be the right supplier.
The KDAB Group is a globally recognized provider for software consulting, development and training, specializing in embedded devices and complex cross-platform desktop applications.
Read more about the history, the values, the team and the founder of the company.
When working with KDAB you can expect quality software and the desired business outcomes thanks to decades of experience gathered in hundreds of projects of different sizes in various industries.
Have a look at selected examples where KDAB has helped customers to succeed with their projects.
KDAB is committed to developing high-quality and high-performance software, and helping other developers deliver to the same high standards.
We create software with pride to improve your engineering and your business, making your products more resilient and maintainable with better performance.
KDAB has been the first certified Qt consulting and software development company in the world, and continues to deliver quality processes that meet or exceed the highest expectations.
In KDAB we value practical software development experience and skills higher than academic degrees. We strive to ensure equal treatment of all our employees regardless of age, ethnicity, gender, sexual orientation, nationality.
Interested? Read more about working at KDAB and how to apply for a job in software engineering or business administration.
Update: Here you have also the Chinese version, thanks goes to Foruok.
In the last Qt on Android episode we learned the basics of JNI on Android in a Qt way. In this episode I'd like to focus on tools that will help us to be more productive when we extend our Qt on Android applications.
Using an external IDE to manage Java files.
Sadly, the Java support in Qt Creator is very limited, and in order to be productive we need to use an external IDE to easily extend and debug the Java part of our application. Android provides two powerful IDEs:
Android Studio
Eclipse (recently deprecated).
This article will focus only on Android Studio.
But before we talk more about tools, let's check the Android specific files which are part of your project.
As I told you in the first article, any Qt on Android application has two big parts:
The native part, which is your C/C++ [Qt] code built into one or more .so files.
The Android specific part:
Android manifest file.
Android build system file(s).
Two Java classes which are needed to load your application dependencies, the application .so files and start the application.
Ministro service .aidl files and other resources, e.g. assets, strings, images, etc.
All the Android specific files are needed to build your android package (as we learned in episode 3). But where are all these files? Why are only a few files copied to your sources when you press "Create templates" button (as shown in the next image)?
Well, Java, Ministro service .aidl files and some resources are kept "hidden" in your Qt SDK. We don't want to copy them to your source tree for two reasons:
We might change them from version to version and we might break the compatibility. If they are part of your project it will be impossible to upgrade them and your application will misbehave (e.g. Java files from Qt 5.4 might not be compatible with Qt 5.5).
We don't want you to change them, because the code in these files is quite sensible, hard to explain and understand and changing them might break your application behavior. If you should not change them, then all your applications will share the same files, so again there is no point in copying them :).
Before Qt 5.4 it was quite complicated to extend the Java part of your application, mostly because you could not use an external IDE (Eclipse) in a decent way (e.g. with syntax highlighting, code-completion, code-refactoring, etc.). In order to get these goodies you had to manually copy all the Java files from Qt SDK installation folder to your application source folder, but as I said, we don't want you to do that and the only way to do it was to copy them locally and not add them to your SCM...
But starting with Qt 5.4. the situation changed when I added Gradle support to Qt 5.4 and to Qt Creator 3.3. Gradle is the new recommended android build system which is used by Android Studio. Using Gradle we can keep all these files hidden and still give you all the goodies that you expect from a 21st century IDE. So, if you are planning to extend your Java part of your application, it is highly recommended to Copy the Gradle files to Android directory as shown in the next image:
Besides the AndroidManifest.xml and res/values/libs.xml files, the wizard will copy a few more:
build.gradle - this is the project file needed by Android Studio.
gradlew[.bat] - build script wrapper used to build Java part and to create final APK.
gradle/wrapper/* - build script wrapper files
build.gradle is very important, it allows you to easily add dependencies to your project.
E.g. to add PlayServices to your application you just need to add:
to build.gradle, check this page for more info on this matter.
Now let's see how to use Android Studio with Qt:
Android Studio will be used only to:
open the Gradle project.
create, edit the java files.
debug the Java part.
Android Studio will NOT be used to run your Qt application, you still need to use Qt Creator for that job!
Let's take a look on how to import the Java part of your Qt application and how to debug it.
The import step is very easy: you just need to Open the existing build.gradle project file. Check the following image:
Warning: Qt 5.4.0 users should upgrade their gradle files using Qt 5.4.1 or later (press again Create templates button and overwrite only gradle files). This step is needed because Qt 5.4.0 uses an old Gradle plugin and, after we released it, Google, as usual, broke the compatibility with older Gradle plugins and Android Studio doesn't import Qt 5.4.0 projects.
The last thing we are going to learn today is how to debug the Java part using Android Studio. You need to take the following steps:
set the breakpoints
attach debugger (Run->Attach debugger to Android process)
start the application using QtCreator
wait for application to start (you should see it in Attach debugger dialog).
select the application
click the OK button
After the last step, your application will be stopped by Android Studio when it hits first breakpoint.The problem comes when we need to start the debugging very early. To do that we are going to use the old fashioned sleep trick Debug.waitForDebugger() function.
Now the application waits until a debugger attaches, then in resumes the execution.
Now that we have learned the basics of the JNI and how to use external tools to make la vie en rose (or la dolce vita), in the next article we will talk about Qt on Android apps architecture: how to extend the Java part of your application using a real life example to show how to correctly do safe calls from Qt thread to Android UI thread and vice-versa.
Instead of using Thread.sleep(10000), you should use Debug.waitForDebugger(); with the import android.os.Debug
This will be easier ^^
20 - Apr - 2015
BogDan Vatra
Thanks for the tip, I updated the post.
20 - Apr - 2015
Karen F.
Hey Bogdan!
My question is not totally related to this episode (I have read all of them, maybe to the first episode more), rather to the story of Qt on Android. What I need is running QML in a single view or fragment in my existing app. Is that possible with some hacks?
I already checked that the android build generates a project which is perfectly compilible in Eclipse, for example. In theory I would like to create a qml app in QtCreator, get the generated project with all the .so files and loading/working logic and continue in Eclipse/Java world - updating the qt part from time to time when enhancing QML program. This can be done on activity level, when the QML part is given it's own activity. But I would like to give it just a view (or fragment). I thought that in theory I can give it a surface, I even found a QtSurface class and other classes intended for drawing QML stuff. I have seen that the generated Qt activity has eventually just one view having all the program running in it.
Let me know your thoughts on this, if this is possible.
Thanks!
20 - Apr - 2015
BogDan Vatra
Theoretically it might be possible, but it will not be easy at all :) .
Thanks, I will definitely check that! Meanwhile, I did a small hack - since I didn't get deep enough into the codes to understand how to create that view holding qml, I just used the one created for me - overriding setContentView in QtActivity and put the view given to it wherever I want. This has a lot of limitations, of course (like only one "qml view") but is a good starting point for research.
19 - Mar - 2019
James S.
Karen, I need to do something similar.... Did you ever get this working?
22 - Apr - 2015
Albert
Really informative! Really, thank you very much!
Qt as a poor documentation about JNI.
I'm currently trying to read some NFC tags from qt. I have made a small program which work perfectly with Android Studio (it just display the UID in the middle of the screen).
Can I load this Java code using natives (as you well explained on episode 5)?
I see your point for calling function, but what about onCreate, onNewIntent,etc?
Thanks again!
20 - May - 2015
Hammer
Thanks BogDan for these useful stuffs. But can you show me a way to continue running the C++ part by service? And the C++ part should be in interact with QML (when the user has opened the app)
The GUI (qml) part and Keep-Alive when the app closed is very important.
the C++ and QML part is ready and working like a charm but i dont know how switch it to Keep-Alive Android Service when the user closing the application.
Thank you
28 - May - 2015
BogDan Vatra
I think you'll need to wait for https://codereview.qt-project.org/#/c/110625/ to be reviewd and to get in. But it will not solve all your problems, because most probably the service and the UI will run in different processes.
If you don't want to wait that much for that patch, you can use the information from episode 5 to episode 7 and create your own service. This way you'll have more control on how it interacts with your application.
12 Comments
17 - Apr - 2015
BuzBuz
Instead of using Thread.sleep(10000), you should use Debug.waitForDebugger(); with the import android.os.Debug
This will be easier ^^
20 - Apr - 2015
BogDan Vatra
Thanks for the tip, I updated the post.
20 - Apr - 2015
Karen F.
Hey Bogdan!
My question is not totally related to this episode (I have read all of them, maybe to the first episode more), rather to the story of Qt on Android. What I need is running QML in a single view or fragment in my existing app. Is that possible with some hacks? I already checked that the android build generates a project which is perfectly compilible in Eclipse, for example. In theory I would like to create a qml app in QtCreator, get the generated project with all the .so files and loading/working logic and continue in Eclipse/Java world - updating the qt part from time to time when enhancing QML program. This can be done on activity level, when the QML part is given it's own activity. But I would like to give it just a view (or fragment). I thought that in theory I can give it a surface, I even found a QtSurface class and other classes intended for drawing QML stuff. I have seen that the generated Qt activity has eventually just one view having all the program running in it. Let me know your thoughts on this, if this is possible.
Thanks!
20 - Apr - 2015
BogDan Vatra
Theoretically it might be possible, but it will not be easy at all :) .
Qt needs a SurfaceView (not a simple View !) to draw its scene, check http://www.kdab.com/future-qt-android-looks-bright for more info on this matter.
It will be easier to do it the other way around, to put native controls on top of your QML application. If you want a pure Android UI and still use QML, J-P Nurmi started such a project, check http://lists.qt-project.org/pipermail/development/2015-April/021149.html .
21 - Apr - 2015
Karen F.
Thanks, I will definitely check that! Meanwhile, I did a small hack - since I didn't get deep enough into the codes to understand how to create that view holding qml, I just used the one created for me - overriding setContentView in QtActivity and put the view given to it wherever I want. This has a lot of limitations, of course (like only one "qml view") but is a good starting point for research.
19 - Mar - 2019
James S.
Karen, I need to do something similar.... Did you ever get this working?
22 - Apr - 2015
Albert
Really informative! Really, thank you very much! Qt as a poor documentation about JNI. I'm currently trying to read some NFC tags from qt. I have made a small program which work perfectly with Android Studio (it just display the UID in the middle of the screen). Can I load this Java code using natives (as you well explained on episode 5)? I see your point for calling function, but what about onCreate, onNewIntent,etc? Thanks again!
20 - May - 2015
Hammer
Thanks BogDan for these useful stuffs. But can you show me a way to continue running the C++ part by service? And the C++ part should be in interact with QML (when the user has opened the app) The GUI (qml) part and Keep-Alive when the app closed is very important. the C++ and QML part is ready and working like a charm but i dont know how switch it to Keep-Alive Android Service when the user closing the application. Thank you
28 - May - 2015
BogDan Vatra
I think you'll need to wait for https://codereview.qt-project.org/#/c/110625/ to be reviewd and to get in. But it will not solve all your problems, because most probably the service and the UI will run in different processes.
If you don't want to wait that much for that patch, you can use the information from episode 5 to episode 7 and create your own service. This way you'll have more control on how it interacts with your application.
28 - May - 2015
foruok
Hi,BogDan,here is the Chinese version: http://blog.csdn.net/foruok/article/details/46115131
28 - May - 2015
BogDan Vatra
Thanks.
19 - Feb - 2018
TAIM
Please make an update, the images are not shown in the article. QTC_CopyAndroidTemplatesCopyGradle_o.png