Porting Qt Application (desktop) to Android App
-
Dear Qt Community,
I am trying to port a Qt Desktop application to Android. I have set up the environment on Windows with latest Qt 5.12 and Qt Creator 4.8.1. On the Desktop GUI application purely Qt C++ with QTcpSocket. The GUI application has launch button - which will launch a executable (Windows .exe) file with embedded in resource. (when user click the button)
My team is porting this application to Android 6.0 as proof of concept. Similar in Android, when a button pressed, a Test android service should be launched and keep running. There is 2 question, Please bear with if miss any basic concept here
As new to Android development /porting, i am clueless- Lets assume, Test android service which ping to Google /Web server in the background when launched (or any simple task)
- As said in the beginning , it is a proof of concept, When button clicked from ported Android app - it should launch the Test android service and it should run on the background service.
No need to communicate back to main app.
What is correct and easy way. Is the Test android service can be stand-alone java code/application , then i call that from Qt Android (ported) app. (Unlike Desktop can not embedded in resource) or any better way... just for Proof of concept.
Am i missing any basic points? Any suggestion useful.
Cheers!
Chandra -
hi,@Chandras002
IIRC then Qt supports since 5.7 android services, and it's gotten even easier since the introduction of QRemoteObjects.
I'vent yet done a project myself with that, but I would recommend this block post by KDAB that is rather good.
https://www.kdab.com/qt-android-create-android-service-using-qt/
It should contain everything you'll need.
And you should be able to pack everything into one single apk file, if I understand the concept correctly.
-
Hi Hilk,
I have seen that link earlier but did not go through in details. Seems that comments for that also very useful. Thanks.