Sophie

Sophie

distrib > Mageia > 6 > i586 > by-pkgid > f93881942bd3805980c2fe63aa853d78 > files > 14

qtdoc5-5.9.4-1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- android.qdoc -->
  <title>Getting Started with Qt for Android | Qt 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt 5.9</a></td><td >Getting Started with Qt for Android</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#installing-the-prerequisites">Installing the Prerequisites</a></li>
<li class="level2"><a href="#updating-the-android-sdk">Updating the Android SDK</a></li>
<li class="level1"><a href="#configuring-your-development-host">Configuring Your Development Host</a></li>
<li class="level2"><a href="#windows">Windows</a></li>
<li class="level2"><a href="#64-bit-linux">64-bit Linux</a></li>
<li class="level2"><a href="#qt-creator-ide">Qt Creator IDE</a></li>
<li class="level1"><a href="#testing-your-setup">Testing Your Setup</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Getting Started with Qt for Android</h1>
<span class="subtitle"></span>
<!-- $$$androidgs.html-description -->
<div class="descr"> <a name="details"></a>
<a name="installing-the-prerequisites"></a>
<h2 id="installing-the-prerequisites">Installing the Prerequisites</h2>
<p>In order to use <a href="android-support.html">Qt for Android</a>, you need the following:</p>
<ul>
<li><a href="http://developer.android.com/sdk/index.html">The Android SDK Tools</a><p><b>Note: </b>If your Qt version is earlier than v5.9, use the SDK tools package v25.2&#x2e;5 or earlier.</p></li>
<li><a href="http://developer.android.com/tools/sdk/ndk/index.html">The Android NDK</a> (recommended version 10e)</li>
<li><a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html">Java SE Development Kit</a> (JDK) v6 or later. You can also use <a href="http://openjdk.java.net">OpenJDK</a> on Linux.</li>
</ul>
<p>After installing these tools, update the Android SDK by installing the API and build tools packages required for development. You can install these packages either through Android Studio or using the command line tools package you installed earlier. For more details, refer to the <a href="https://developer.android.com/studio/intro/update.html">Android Studio</a> documentation.</p>
<a name="updating-the-android-sdk"></a>
<h3 >Updating the Android SDK</h3>
<p>The command line tools provided by the Android SDK Tools package also enables updating the SDK, but without a GUI. For example, the following command on Ubuntu updates the SDK by installing the latest <code>build-tools</code>, <code>platform-tools</code>, <code>emulator</code>, and <code>patcher</code> packages:</p>
<pre class="cpp plain">

  ./android update sdk

</pre>
<p>To install a specific package, use <code>sdkmanager</code> from <code>&lt;ANDROID_SDK_ROOT&gt;/tools/bin</code>. For example, the following command installs the <code>android-10</code> platforms package on Ubuntu:</p>
<pre class="cpp plain">

  ./sdkmanager &quot;platforms;android-10&quot;

</pre>
<p>For more details, refer to the <a href="https://developer.android.com/studio/command-line/sdkmanager.html">sdkmanager</a> documentation.</p>
<a name="configuring-your-development-host"></a>
<h2 id="configuring-your-development-host">Configuring Your Development Host</h2>
<a name="windows"></a>
<h3 >Windows</h3>
<p>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 <i>extras</i> Android SDK package. Use the following command from the Windows command prompt to install the extras package:</p>
<pre class="cpp plain">

  sdkmanager.bat &quot;extras;google;usb_driver&quot;

</pre>
<p>After the package installation is complete, install the driver from <code>&lt;ANDROID_SDK_ROOT&gt;/extras/google/usb_driver</code>. Try running a few basic <a href="http://developer.android.com/tools/help/adb.html">adb</a> commands now and check whether your Android device responds to it.</p>
<a name="64-bit-linux"></a>
<h3 >64-bit Linux</h3>
<p>If you're developing on a 64-bit Linux machine, you must install the following dependencies in order to run 32-bit executables like <code>adb</code>, which allows Qt Creator to find devices to deploy to:</p>
<pre class="cpp plain">

  sudo apt-get install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386

</pre>
<p>To run the emulator, the following dependencies are also necessary:</p>
<pre class="cpp">

  sudo apt<span class="operator">-</span>get install libsdl1<span class="operator">.</span><span class="number">2debian</span>:i386

</pre>
<a name="qt-creator-ide"></a>
<h3 >Qt Creator IDE</h3>
<p>The Qt Creator IDE that came with the Qt 5 installation on your development host, must be configured to enable developing applications for Android. Launch Qt Creator and select <b>Tools</b> &gt; <b>Options</b> &gt; <b>Devices</b> &gt; <b>Android</b> to add the Android NDK and SDK paths. For more details, refer to <a href="http://doc.qt.io/qtcreator/creator-developing-android.html">Qt Creator Manual</a>.</p>
<a name="testing-your-setup"></a>
<h2 id="testing-your-setup">Testing Your Setup</h2>
<p>Now you can test your development setup by running the examples that came with the Qt 5 installation. You can browse these examples in Qt Creator <b>Welcome</b> mode. Use the <code>android</code> filter in the search field to list all the examples tested on Android.</p>
<p>To develop a simple application from scratch, see <a href="http://doc.qt.io/qtcreator/qtcreator-accelbubble-example.html">Creating a Mobile Application</a>.</p>
</div>
<!-- @@@androidgs.html -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>