summaryrefslogtreecommitdiff
path: root/doc/src/platforms/android/android.qdoc
blob: 5803e205e64fd6920a70acbaf49de8ffa345d82f (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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
    \page android.html
    \title Qt for Android
    \brief Provides information about Android support in Qt.
    \ingroup supportedplatform
    \previouspage Android GNU C++ Run-time Licensing
    \nextpage android-getting-started.html

    Qt for Android enables you to develop Qt applications for Android devices,
    and supports a wide range of features and use-cases.

    To download and install Qt for Android, follow the instructions on the
    \l{Getting Started with Qt for Android} page. To build Qt from source,
    see \l{Qt for Android - Building from Source}{Building from Source}.

    \target android-supported-configurations
    \section1 Supported Configurations

    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.

    \section1 Where to Go from Here

    We invite you to explore the rest of Qt. We prepared overviews which help
    you decide which APIs to use and our examples demonstrate how to use our
    APIs.

    \list
    \li \l{Qt Overviews} - list of topics about application development
    \li \l{Qt Examples and Tutorials}{Examples and Tutorials} - code samples and tutorials
    \li \l{Qt Reference Pages} - a listing of C++ and QML APIs
    \li \l{Qt Creator: Creating a Mobile Application}
    \li \l{Qt Creator: Specifying Android Device Settings}
    \endlist

    The following topics also provide more details about Qt for Android:

    \annotatedlist androidplatform

    Qt's vibrant and active \l{https://www.qt.io/developers}{community site}
    houses a wiki, a forum, and additional learning guides and presentations.
*/

/*!
    \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

    The video below is a beginner's guide to using the Qt for Android toolchain,
    including the Qt Creator IDE, to get you started developing Android apps.

    \youtube 5OiIqFTjUZI

    The rest of this page has more detailed getting started information.

    To download and install Qt for Android, follow the instructions on the
    \l{Getting Started with Qt} page.

    \section1 Android Development Prerequisites

    In order to develop with \l{Qt for Android}, you will also need the following
    prerequisites:

    \list
        \li Java Development Kit (JDK) for Java development
        \li \l{Android: Android command line tools}{Android SDK Command Line Tools}
            for managing dependencies required for developing with Qt for Android,
            including:
            \list
                \li \l{Android: Android SDK Platforms}{Android SDK Platform}
                \li \l{Android: Android SDK Platform Tools}{Android SDK Platform Tools}
                \li \l{Android: Android SDK Build Tools}{Android SDK Build Tools}
                \li \l{Android: The Android NDK}{Android NDK}
            \endlist
    \endlist

    The easiest way to manage these dependencies is by using Qt Creator's built in
    Android development setup. For more information, see
    \l{Qt Creator: Specifying Android Device Settings}.

    \section2 Manually Installing the Prerequisites

    If you prefer to manually install the prerequisites please follow
    these next steps.

    \section3 Java Development Kit (JDK)

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

    \list
        \li \l{AdoptOpenJDK}
        \li \l{OpenJDK}
        \li \l{Java SE Development Kit}
    \endlist

    Please install your preferred JDK, and then make sure the \c JAVA_HOME
    environment variable is pointing to the location of the installed JDK.

    For example for Linux:

    \badcode
        sudo apt-get install openjdk-11-jdk
        export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
    \endcode

    Or for \macOS:

    \badcode
        brew install openjdk@11
        sudo ln -sfn "$(brew --prefix openjdk@11)/libexec/openjdk.jdk" "/Library/Java/JavaVirtualMachines/openjdk-11.jdk"
        export JAVA_HOME="$(/usr/libexec/java_home -v 11)"
    \endcode

    \section3 Android SDK Command Line Tools

    Install the latest version of the
    \l{Android: Android command line tools}{Android SDK Command Line Tools}
    for your operating system, and verify that the installation succeeded by running
    the \l{Android: sdkmanager}{sdkmanager} binary:

    \badcode
        sdkmanager --version
    \endcode

    Then make sure the \c ANDROID_SDK_ROOT environment variable is pointing to the
    location of the installed command line tools.

    For example for \macOS:

    \badcode
        brew install android-commandlinetool
        export ANDROID_SDK_ROOT="$(brew --prefix)/share/android-commandlinetools"
    \endcode

    \section3 Android SDK

    The required version of the Platform, Platform Tools, and Build Tools for \QtVer is 31.

    To install all of these run the following command:

    \badcode
        sdkmanager "platforms;android-31" "platform-tools" "build-tools;31.0.0"
    \endcode

    \section3 Android NDK

    The required version of the Android NDK for \QtVer is 25.1.8937393.

    To install the NDK run the following command:

    \badcode
        sdkmanager "ndk;25.1.8937393"
    \endcode

    Then make sure the \c ANDROID_NDK_ROOT environment variable is pointing to the
    location of the installed NDK.

    For example for \macOS:

    \badcode
        export ANDROID_NDK_ROOT="$(brew --prefix)/share/android-commandlinetools/ndk/23.1.7779620/"
    \endcode

    \section3 Emulator

    If you wish to use the \l{Android: Android Emulator}{Android Emulator},
    you can install it by running:

    \badcode
        sdkmanager "emulator" "patcher;v4"
    \endcode

    \section3 Platform Specific Configurations

    \section4 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 "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.

    \section4 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

    \section3 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}.
*/