PDA

View Full Version : Android GUI development for existing c++ project



nandrius
16th October 2019, 09:17
Hello everyone.
I am new to Qt and could really use some help in this one.

What I am trying to do:
As the title says, I have a rather complex c++ project that runs on terminal which I want to port to mobile.
This project,in order to execute, takes some user input,calculates the results and then prints them on screen.
What I want to do is build some simple GUI for Android where the user can input those variables,pass them to the main project and then print the output.
How can I achieve this in Qt? Can someone put me in the right track on this on what tools do I need for my environment and how to proceed?

Thanks in advance.

kbsk007
16th October 2019, 17:14
look at: youtube android app qt creator.

d_stranz
16th October 2019, 17:18
You first need a cross-compiler for Android, which you can probably get from Google. This needs to be installed and integrated into your development tool. For Qt Creator, you add it as a kit.

You should then verify that you can actually build your project as-is using the cross-compiler. Install and run the apk on Android to verify it works in terminal mode. You can use VirtualBox to install Android as a virtual machine and run it on your PC inside the VM. Obviously, things like touch probably won't work with the VM, but mouse and keyboard will.

Next, you should implement a GUI in Qt in your PC's native OS (not Android), and get it working. This is far easier than trying to implement it on Android only.

Next, you port it to Android OS. You will need to install a Qt distribution on your PC that is compatible with the cross-compiler you have installed. In Qt Creator, switch the target to use the Android kit and rebuild the project. You will then need to learn how to deploy and debug this executable either on a real Android device or in the VM.

That's about as much advice as I can give you. It has been years since I have played around with developing an Android app with Qt and I would have to re-learn it all.

Others on this forum might be able to give you advice on the details. You could also read the Qt documentation on Qt Creator, Android, and cross-platform development.