I have been working with Qt for a very long time, but recently I decided to study programming for android. At the moment, the task is to write some application, the functional part (service) is quite complicated, and the display (activation) is simple. I decided to write an activation in android studio, and a service in Qt using QAndroidService and QtService (for native code). Of course, it would be possible to make just 2 applications - activation and service with the exported parameter, but this is a bit of a crutch method, and for the service requires some permissions, and to install them you need to make the initial launch. In general, how can I connect the service created in Qt to the Android studio project? Thank!

    1 answer 1

    If you pulled Qt on Android, then something like this:

    Java

    public class AndroidService extends QtService { } 

    Further documentation:

    Uncomment your AndroidManifest.xml service. Make sure the service tag contains an android: process = ": some_name" attribute. It is needed to complete the process. If you’re using the same application, it’s not a problem. To enable background running, uncomment android.app.background_running meta-data and set it to true (android: value = "true").

    AndroidManifest.xml

      <service android:process=":qt" android:name=".AndroidService"> <meta-data android:name="android.app.background_running" android:value="true"/> </service>