summaryrefslogtreecommitdiff
path: root/doc/src/platforms/android/android.qdoc
blob: c63d84bd58284b599ef08d9f9b36cf9b0f03dd0c (plain)
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
\page android.html
\title Qt for Android
\brief Provides information about Android support in Qt.
\ingroup supportedplatform
\previouspage android_runtime_licensing_notes.html
\nextpage android-getting-started.html

Qt for Android enables you to run Qt applications on Android devices.

For Qt modules that support android targets see:
\l{All Modules}{All Supported Qt Modules}.

The following development environments and target system configurations are
supported in Qt \QtVer:

\include supported-platforms.qdocinc android

    \table 50%
    \header \li {4,1} Target Devices used in Automated Testing
        \header \li Device \li OS Version \li Architecture \li Form Factor
        \row \li \l{Pixel 3A}
             \li Android 10 (API 29)
             \li armv7, arm64_v8a
             \li Mobile
        \row \li \l{Pixel 4A}
             \li Android 12 (API 31)
             \li armv7, arm64_v8a
             \li Mobile
         \row \li \l{Samsung Galaxy Tab S4}
             \li Android 10 (API 29)
             \li armv7, arm64_v8a
             \li Tablet
         \row \li \l{Google Pixel 6 Pro}
             \li Android 13 Beta 4.1
             \li armv7, arm64_v8a
             \li Mobile
         \row \li \l{Samsung Galaxy S21}
             \li Android 12 (API 31)
             \li armv7, arm64_v8a
             \li Mobile
         \row \li \l{Motorola MotoG 3rd}
             \li Android 6.0.1 (API 23)
             \li armv7
             \li Mobile
         \row \li Huawei Honor
             \li Android 6.0.1 (API 23)
             \li armv7, arm64_v8a
             \li Mobile
         \row \li \l{Samsung Galaxy S10}
             \li Android 9 (API 28)
             \li armv7, arm64_v8a
             \li Mobile
         \row \li \l{Pixel 4}
             \li Android 11 (API 30)
             \li armv7, arm64_v8a
             \li Mobile
        \endtable

\note Qt for Android support is inclusive of \b{but not limited to} these devices.

\note The above table is accurate at the time of this Qt patch release only.
It may change during the patch release cycle and should only be used as a
reference for what the Qt Company can rapidly reproduce bugs on.

Here is what you can do with Qt for Android:

\list
    \li Run \l{Qt Widgets}{Widget-based} and \l{QML Applications}{QML}
        applications on a device or an emulator.
    \li Support for the \l{Material Style}{Material Style} with
        Qt Quick Controls.
    \li Handle \l{Qt Multimedia}{Multimedia} content.
    \li Get \l{Qt Sensors}{sensor} readings.
    \li Retrieve positioning data using satellite or network information.
    \li Connect and exchange data with \l{Qt Bluetooth}{Bluetooth}
        and \l{Qt NFC}{NFC}-enabled devices.
    \li Develop secure applications using OpenSSL library.
    \li Create \l{Android Services}.
    \li Create and deploy Application Package (APK) and Android App Bundle (AAB)
        packages using Qt Creator.
\endlist

See \l{Getting Started with Qt for Android}.

The following topics provide more details about Qt for Android:
\annotatedlist androidplatform

*/

/*!
\page android-getting-started.html
\title Getting Started with Qt for Android
\brief Provides instructions to install and configure your development environment.
\ingroup androidplatform
\previouspage android.html
\nextpage android-building.html

\section1 Installing Qt for Android with Qt Installer

See \l{Get and Install Qt} and select Qt for Android in the installer.

\section1 Manually Installing the Prerequisites
In order to use \l{Qt for Android}, you need the following:

\list
    \li Java Development Kit 11 (JDK) or above provided by \l{AdoptOpenJDK} for all platforms,
        is required to build Android apps. Other alternatives such as \l{OpenJDK}
        for Linux and macOS or \l{Java SE Development Kit} for Windows are also supported.

    \li \l{Gradle} 7.2 for building application packages (APK) and app bundles
        (AAB) for Android devices. Gradle is delivered with Qt.

    \target android-sdk
    \li \l{Android: The Android SDK Tools}{The Android Command-line SDK Tools}
        to install the following packages that are required to compile Qt
        applications for Android:

        \list
            \li Platform tools
            \li Build tools
            \li At least one SDK platform
            \li \l {android-ndk}{The Android NDK}, which contains toolchains
                and debuggers for Android.
        \endlist

        \note Qt Creator 4.12 or later can set up the SDK Tools, NDK, and
        essential packages automatically. For more information, see
        \l {Qt Creator: Specifying Android Device Settings}.


    Qt for Android development requires JDK 11 or above, provided by any of the
    following supported distributions:

    \target android-ndk
    \li \l{Android: The Android NDK}{The Android NDK}
        can be installed using the \c sdkmanager tool. Alternatively, you can
        download it and extract it manually to a path of your choosing.
\endlist

\include supported-platforms.qdocinc android

\note Make sure to unpack the Android SDK and NDK to a writable location that Qt Creator
can access later. Otherwise, Qt Creator won't be able to use \c sdkmanager or find all
components even if they were installed manually.

\section2 Installing the Android SDK Essentials

After downloading and unpacking the Commandline SDK Tools, use the \c sdkmanager
command line tool to install the essential packages:

\badcode
cd <ANDROID_SDK_ROOT>/tools/bin/
./sdkmanager --sdk_root=<ANDROID_SDK_ROOT> --install "cmdline-tools;latest" "platform-tools" "platforms;android-31" "build-tools;31.0.0" "ndk;22.1.7171670"
\endcode

\l {Android: Android Studio}{Android Studio} or the Qt Creator's
\l{Qt Creator: Managing Android SDK Packages}{SDK Manager UI} can also be used
to install the essential SDK packages.

To use the \l {Android: Android Emulator}{Android Emulator}, install it by
entering:

\badcode
./sdkmanager --sdk_root=<ANDROID_SDK_ROOT> --install "emulator" "patcher;v4"
\endcode

\section1 Host Specific Configuration

\section2 Windows

The default USB driver on Windows does not allow debugging using
Android Debug Bridge (ADB) tool. You must install the additional USB driver
provided by the \e extras Android SDK package. To install it, run the following:

\badcode
sdkmanager.bat --sdk_root=<ANDROID_SDK_ROOT> --install "extras;google;usb_driver"
\endcode

After the package installation is complete, install the driver from
\c{<ANDROID_SDK_ROOT>/extras/google/usb_driver}. Try running a few basic
\l{Android: adb}{adb} commands now and check whether your Android device
responds to them.

\note These are automatically handled by Qt Creator on first time setup.

\section2 Linux

The following dependencies are needed for using tools such as \c adb or \c gdb which
can be used by Qt Creator:

\badcode
sudo apt-get install libstdc++6 libncurses5
\endcode

\target emulator dependencies
To run the Android emulator, the following dependencies are also necessary:

\badcode
sudo apt-get install libsdl1.2debian
\endcode

\section2 Qt Creator IDE

The Qt Creator IDE can be used to develop Qt applications for Android. For more
information, see \l{Qt Creator: Connecting Android Devices}.

\section1 Testing Your Setup

Now you can test your development setup by running the examples shipped with the
Qt installation. For more information, see \l {Qt for Android Examples}.

To develop a simple application from scratch, see
\l {Qt Creator: Creating a Mobile Application}.
*/