Unsolved How to set a Qt app for Android as a Launcher?
-
Creating a Qt and QML app for Android is very convenient with Qt Creator. It’s perfect for quick prototypes. Is it also possible to setup a Qt app as an Android Launcher. I have realized, that Qt Creator creates the Android project structure in the build directory, that includes the AndroidManifest.xml file.
In Android Studio it’s quite simple to setup an app as a launcher by a small modification for the intend filter:
<intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter>
Can I configure my Qt project in a way, that modifies this intend filter?
-
Hi,
AFAIK, you can generate the AndroidManifest.xml for your project within the sources. You can then modify it the way you want it.
-
@sgaist Thanks for your reply. Sounds promising. How can I set up a manifest file? I had a look at the Qt Notifier example project. I assume the following parts of the .pro file are relevant I have to add to my .pro file:
QT += quick androidextras ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources OTHER_FILES += \ android-sources/AndroidManifest.xml
A have also seen, that Qt Creator is able to parse the manifest file and display a form. Here I can define the app name and app icon. Very useful. However the form doesn’t allow to edit the activity and intent filter. So I have to open the text editor.
Do you have a suggestion how to create a manifest file? I may take the one, that is automatically created during the build process of my project?
-
See the Editing Manifest File section in the Android deployment part of the Qt Creator documentation.
-
@sgaist Perfect. This works. Thanks
-
@a-burks great that it works for you, don't forget to use the topic tools to set the topic to solved 😉
-
@j-hilk Thanks. I'll do. I just have to test editing the Manifest file to define the app as a launcher. I realized, that I have to switch from the form view to the text view of this file in Qt Creator.
-
This post is deleted!