1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page android-publishing-to-googleplay.html
\title Publishing to Google Play
\brief Provides instructions to prepare your application for publishing.
\ingroup android-platform-extra-topics
\previouspage android-3rdparty-libs.html
\nextpage Supporting Google Emoji Font Policy
\l{Qt for Android} provides a complete solution to develop, build, and package
your applications for Android. Most of these tasks, especially packaging and
deployment, are handled by \QC, providing a rich developer experience.
Every time you run the application using \QC, an Android Application
Package (APK) is created and deployed onto the target of your choice
(device or emulator). With a few minor changes to packaging settings, you can
publish your application on Google Play.
\section1 Building the App
Once your app has been developed and you want to move forward to publish it
to Google Play, follow these instructions to create an \c{.apk} or \c{.aab}
that can go live on Google Play:
\list 1
\li Open your project with \QC choosing a \c{Release Build}.
\li Select \uicontrol Projects > \uicontrol Build > \uicontrol {Build Android APK}
> \uicontrol {Create Templates} to create the Android package template files
such as \c{AndroidManifest.xml}, which is the main file of concern here.
\li Check for the following settings in \c{AndroidManifest.xml}:
\list
\li Set \uicontrol{Application name} and \uicontrol{Application icon}.
\li Set the app's name using \c {android:label} under the manifest's
\c application section.
\li Set the app's version code and name via CMake's properties
\l {QT_ANDROID_VERSION_NAME} and \l {QT_ANDROID_VERSION_CODE}.
For qmake, use \l {ANDROID_VERSION_NAME} and \l {ANDROID_VERSION_CODE}.
For qmake, we will use \l {ANDROID_VERSION_CODE} below, to work around
publishing multi-ABIs apps.
\endlist
See \l{Qt for Android Manifest File Configuration} for more information.
\li Set \c minimum and \c{target} SDK versions according to your app's needs.
This can be done using the CMake properties \l QT_ANDROID_TARGET_SDK_VERSION
and \l QT_ANDROID_MIN_SDK_VERSION. Or for \c qmake \l ANDROID_TARGET_SDK_VERSION
\l ANDROID_MIN_SDK_VERSION.
\note As before with Qt 5.15, you can specify these settings in the
\c {AndroidManifest.xml}. Be aware that the CMake and qmake properties
mentioned above will override these if set there. See \l{Android: App Versioning}
for more information on setting these in \c build.gradle.
\li Set up a \l{Android: Android keystore system}{keystore} to sign your
package. You can create a new keystore if you do not have one. For more
information, see \l{\QC: Android Deploy Configuration}
{Specifying Settings for Packages}.
\li Locate the generated package:
\list
\li For APK packages, locate the \c{.apk} package at:
\badcode
<build_path>/android-build/build/outputs/apk/release/android-build-release.apk
\endcode
\note In \QC, select \uicontrol{Projects} > \uicontrol{Build}
> \uicontrol{Build Steps} > \uicontrol{Build Android APK} >
\uicontrol{Open package location after build} to build the
application's \c{.apk} and open the directory containing the
package.
\li For AAB packages, select \uicontrol{Projects} > \uicontrol{Build}
> \uicontrol{Build Steps} > \uicontrol{Build Android APK} >
\uicontrol{Build .aab (Android App Bundle)} for \QC to generate
the \c{.aab} file, then locate the package at:
\badcode
<build_path>/android-build/build/outputs/bundle/release/android-build-release.aab
\endcode
\endlist
\endlist
\section1 Uploading the App to Google Play Store
Log into the \l{Google Play Developer Console} and upload the \c{.aab} files,
along with a description and screen captures resembling the usage of your application.
\section2 Multi-ABI Bundles
Uploading one \c {.aab} with all the supported architectures is enough for
Qt versions that support building a multi-ABI bundle. Qt \QtVer supports
building multi-ABI bundles with \b only with CMake. For more information,
see \l {QT_ANDROID_ABIS}.
\section2 Single-ABI bundles
However, publishing your app requires additional steps for Qt versions
that don't have the multi-ABI build support. \c qmake builds in Qt \QtVer
fall into this category.
To publish your app that is built using a single ABI kit, you need
to make sure that each ABI uses a different internal version code.
The version code is an internal non-public identifier for your app's
release. Build each one of the architectures you want to support
and set a different version code for each ABI. This can be done
as follows for qmake:
\badcode
ANDROID_VERSION_CODE = <unique_version>
\endcode
The app developer can use a specific scheme for the version code. For example,
the code could have chunks for the platform, the ABI, and the actual
version. Then, a sample scheme would be \c {<Platform><ABI><AppVersion>}:
\list
\li Platform:
\list
\li 1 for Arm
\li 2 for Intel
\endlist
\li Architecture:
\list
\li 32 for 32 bit
\li 64 for 64 bit
\endlist
\endlist
The resulting version code for release 1.0 for arm64-v8a ABI,
would be \c {16410}.
For more information, see Google's documentation on
\l {Android: App Versioning}{app versioning}.
The following screenshot shows an example of an app targeting 4 ABIs,
while each package uses a unique version code, which is different from
the version name that is the public version string.
\image android-single-abis.png
\sa {Deploying an Application on Android}.
*/
|