forked from qt-creator/qt-creator
131 lines
4.6 KiB
Plaintext
131 lines
4.6 KiB
Plaintext
![]() |
/****************************************************************************
|
||
|
**
|
||
|
** This file is part of Qt Creator
|
||
|
**
|
||
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||
|
**
|
||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||
|
**
|
||
|
**
|
||
|
** GNU Free Documentation License
|
||
|
**
|
||
|
** 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.
|
||
|
**
|
||
|
** If you have questions regarding the use of this file, please contact
|
||
|
** Nokia at qt-info@nokia.com.
|
||
|
**
|
||
|
****************************************************************************/
|
||
|
|
||
|
/*!
|
||
|
|
||
|
\contentspage index.html
|
||
|
\previouspage creator-developing-qnx.html
|
||
|
\page creator-developing-android.html
|
||
|
\nextpage creator-build-process-customizing.html
|
||
|
|
||
|
\title Connecting Android Devices
|
||
|
|
||
|
You can connect Android devices to the development PC to build, run, debug,
|
||
|
and analyze applications on them from \QC.
|
||
|
|
||
|
If you have a tool chain for building applications for Android devices
|
||
|
installed on the development PC, you can add it to \QC. You can then select
|
||
|
the \gui {Android} target to run applications on Android devices.
|
||
|
|
||
|
\section1 Requirements
|
||
|
|
||
|
To use \QC to develop Qt applications for Android, you need the following:
|
||
|
|
||
|
\list
|
||
|
|
||
|
\o OpenJDK Java Development Kit
|
||
|
|
||
|
To check whether you have OpenJDK installed, enter the following
|
||
|
command:
|
||
|
|
||
|
\c {java -version}
|
||
|
|
||
|
To install OpenJDK, enter the following command:
|
||
|
|
||
|
\c {sudo apt-get install openjdk-6-jdk}
|
||
|
|
||
|
\o \l{http://ant.apache.org/bindownload.cgi}{Apache Ant} 1.8.0, or
|
||
|
later
|
||
|
|
||
|
To check the Ant version, enter the following command on the command
|
||
|
line:
|
||
|
|
||
|
\c {ant -version}
|
||
|
|
||
|
\o \l{http://necessitas.kde.org/necessitas/necessitas_sdk_installer.php}
|
||
|
{Necessitas SDK}
|
||
|
|
||
|
\endlist
|
||
|
|
||
|
\section1 Configuring Connections
|
||
|
|
||
|
The Qt for Android SDK automatically sets the paths to the required software
|
||
|
in \QC.
|
||
|
|
||
|
To configure connections between \QC and Android devices:
|
||
|
|
||
|
\list 1
|
||
|
|
||
|
\o Select \gui Tools > \gui Options > \gui {Build & Run} >
|
||
|
\gui {Qt Versions} > \gui Add to add Qt for Android.
|
||
|
|
||
|
\o In the \gui {qmake location} field, add the \c qmake path from the
|
||
|
Qt for Android SDK
|
||
|
(\c {/opt/necessitas/Android/<qtversion>/bin/qmake} by default).
|
||
|
|
||
|
\o Select \gui Tools > \gui Options > \gui Android to view and edit
|
||
|
paths to the required software.
|
||
|
|
||
|
\image qtcreator-options-android.png "Android options"
|
||
|
|
||
|
\o Select \gui Tools > \gui Options > \gui {Build & Run} >
|
||
|
\gui {Qt Versions} and build the GDB Helper to make the debugging
|
||
|
output for Qt specific constructs clean and easy to read.
|
||
|
|
||
|
\o To build the GDB Helper, select Qt for Android, select \gui Details
|
||
|
in the \gui Helpers section, and then select \gui Build in the
|
||
|
\gui {GDB Helper} field.
|
||
|
|
||
|
\o Select \gui {Start Android AVD Manager} to create Android virtual
|
||
|
devices (AVD) that enable you emulate device hardware and software
|
||
|
on the Android Emulator.
|
||
|
|
||
|
\o To specify information for the Android manifest file, select
|
||
|
\gui Projects > \gui Run, and then select \gui Details to view the
|
||
|
\gui {Package configurations}. For more information about the
|
||
|
options you have, see
|
||
|
\l{Specifying Run Settings for Android Devices}.
|
||
|
|
||
|
\o To specify settings for deploying applications to Android, select
|
||
|
\gui Details to view the \gui {Deploy configurations}. For more
|
||
|
information about the options you have, see
|
||
|
\l{Deploying Applications to Android Devices}.
|
||
|
|
||
|
\endlist
|
||
|
|
||
|
\section1 Debugging on Android Devices
|
||
|
|
||
|
Android devices support debugging multi-thread applications in version
|
||
|
2.2.1 and later. If you use AVD, select Android 2.3, or later. For more
|
||
|
information, see the Android documentation.
|
||
|
|
||
|
In addition, debugging is supported at android-10 API level, or higher. In
|
||
|
the run settings for the project, in the \gui {Android target SDK} field,
|
||
|
select android-10, or higher. For more information about Android API levels,
|
||
|
see \l{http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels}
|
||
|
{What is API Level?}.
|
||
|
|
||
|
\note Select a \l{glossary-build-config}{debug build configuration} to build
|
||
|
the application for debugging.
|
||
|
|
||
|
*/
|
||
|
|