From 8e70fd1d9e535ef73100a7102183184f7671caeb Mon Sep 17 00:00:00 2001 From: BogDan Vatra <bogdan@kdab.com> Date: Wed, 17 Feb 2016 18:44:27 +0200 Subject: [PATCH] Add Android Services documentation. Change-Id: Ibb07fc474936243dc5f68c49c2296681c31e4179 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> --- doc/src/platforms/android.qdoc | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/doc/src/platforms/android.qdoc b/doc/src/platforms/android.qdoc index 7c794e14..8da0759a 100644 --- a/doc/src/platforms/android.qdoc +++ b/doc/src/platforms/android.qdoc @@ -54,6 +54,7 @@ The following list summarizes what you can do with Qt for Android: \li Integrate Java code into your application using \l{Qt Android Extras}. \li Develop secure applications using OpenSSL library. + \li Create \l{Android Services} \li Create and deploy Application Package (APK) using Qt Creator. \endlist @@ -62,6 +63,7 @@ The following topics provide more details about how to use Qt for Android: \li \l{Getting Started with Qt for Android}{Getting Started} \li \l{Porting to Android}{Porting a Qt Application} \li \l{Adding OpenSSL Support} + \li \l{Android Services}{Creating Android Services} \li \l{Third-party Android Libraries}{Including third-party Android libraries in an application} \li \l{Qt Creator: Deploying Applications to Android Devices}{Deploying to the Device} \li \l{Publishing to Google Play} @@ -418,3 +420,41 @@ a larger audience. See \l{Deploying an Application on Android} for more information about how the packaging is done and how you can influence it. */ + + +/*! +\page androidservices.html +\title Android Services +\brief Provides information about Android Services support in Qt. + +Starting with Qt 5.7 you can use Qt to create Android services. A service +is a component that runs in background, so, it has no user interface. It is +useful to perform long-time operations (for example log GPS, wait for social +media notifications, and so on). A service will continue to run even if the +application that started it exits. + +To create a service, you need to do the following steps: +\list 1 + \li Uncomment the service part of your AndroidManifest.xml + + \li Make sure the \c service tag contains an \c android:process=":some_name" + attribute. It is needed to force the \c service to run in a separate + process than the \c activity. + + \li If you're using the same application (.so file) for activity and also + for service, you need to use \c android.app.arguments \c meta-data to + pass some arguments to your \c main function in order to know which one + is which. + + \li Enable background running. Uncomment \c android.app.background_running + \c meta-data and set it to true (\c android:value="true" ). + +\endlist + +Qt will load the \c .so file defined in \c android.app.lib_name \c meta-data, +will call the \c main function with all the arguments set in +\c android.app.arguments \c meta-data. + +See \l{http://developer.android.com/guide/components/services.html}{Android Services} +documentation for more info on this matter. +*/ -- GitLab