Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 5ab010e37991249ab4adaa24d6e39c6e > files > 148

qt5-qtdoc-5.1.1-2.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- platform-notes-android.qdoc -->
  <title>Platform and Compiler Notes - Android | QtDoc 5.1</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader"></div>
<div class="content">
<div class="line">
<div class="content mainContent">
<p class="naviNextPrevious headerNavi">
</p><p/>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#android-development-in-qt-creator">Android Development in Qt Creator</a></li>
<li class="level1"><a href="#application-package">Application Package</a></li>
<li class="level1"><a href="#deployment">Deployment</a></li>
<li class="level2"><a href="#deployment-with-ministro">Deployment with Ministro</a></li>
<li class="level2"><a href="#deployment-for-debugging">Deployment for Debugging</a></li>
<li class="level1"><a href="#plugins-and-imports-special-considerations">Plugins and Imports Special Considerations</a></li>
<li class="level1"><a href="#opengl-special-considerations">OpenGL Special Considerations</a></li>
<li class="level1"><a href="#assets-file-system">Assets File System</a></li>
<li class="level1"><a href="#supported-architectures">Supported Architectures</a></li>
</ul>
</div>
<h1 class="title">Platform and Compiler Notes - Android</h1>
<span class="subtitle"></span>
<!-- $$$platform-notes-android.html-description -->
<div class="descr"> <a name="details"></a>
<p>This page contains information particular to building Qt applications for and running them on the Android platform. Qt supports Android versions 2.3&#x2e;3 (API level 10) or later.</p>
<a name="android-development-in-qt-creator"></a>
<h2>Android Development in Qt Creator</h2>
<p>The easiest way to develop with Qt for Android is to use <a href="http://qt-project.org/doc/qtcreator/creator-developing-android.html">Qt Creator</a>. When you apply a <b>Qt for Android Kit</b> to a Qt Creator project, it will create and maintain a set of files which are required to make your app run on Android.</p>
<p>The files added to your project are:</p>
<ul>
<li>Java files which serve as the entry point into your app and which will automatically load Qt and execute the native code in your app</li>
<li>AndroidManifest.xml which provides meta-information about your app</li>
<li>Other XML files detailing the dependencies of your app</li>
<li>Resource files</li>
<li>Depending on the deployment method selected in Qt Creator, additional files like libraries and QML files can be included in the project.</li>
</ul>
<p>Qt Creator adds these files in a subdirectory of your project called <b>android</b>. The contents of the <b>android</b> folder is used as basis for your app's distributable application package.</p>
<a name="application-package"></a>
<h2>Application Package</h2>
<p>On Android, apps are distributed in packages called APK. Qt Creator will manage building the APK for you, but if you for some reason want to do this manually, you must first make sure that the appropriate packaging and build files are in place. As mentioned, Qt Creator will place these files in the <b>android</b> subfolder in your project.</p>
<a name="deployment"></a>
<h2>Deployment</h2>
<p>Qt Creator currently supports three methods of deployment for Android apps: the default deployment method is suitable for distribution of the APK file. With this deployment method, the necessary Qt libraries and files will be copied into your project directory, and bundled as part of the APK, so that you get a stand-alone, distributable application package.</p>
<a name="deployment-with-ministro"></a>
<h3>Deployment with Ministro</h3>
<p>The second method is suitable if you want to minimize the size of your APK, and can be selected by opening the <b>Run</b> settings of your project, expanding <b>Deploy Configurations</b> and removing the tick from the <b>Use local Qt libraries</b> check box. In this case, your application will have an external dependency called <b>Ministro</b>. If a user downloads your application, and it is the first application on their device to depend on Ministro, they will be asked to install it before they can run your application. Ministro downloads Qt libraries from a repository of your choice. The repository URL can be set by editing the file <i>android/res/values/libs.xml</i> which is created by Qt Creator when configuring your project. Ministro will then serve as a central repository for Qt libraries, and several apps can share the libraries to limit the amount of duplication. Note that using this deployment method requires a repository for the libraries you want to distribute.</p>
<a name="deployment-for-debugging"></a>
<h3>Deployment for Debugging</h3>
<p>The third method is more convenient when you are simply testing your application on a device physically connected to your development machine (or an emulator). It will copy the Qt libraries into a temporary directory on your device and run the application against these instead. An APK built in this way is not distributable, since it relies on the device being prepared to contain the Qt libraries in the correct location. However, since the Qt libraries are only copied into the device once, it benefits from a faster turn-around time, so it's more suited for testing changes to your application during development. This deployment method can be selected by opening the <b>Run</b> settings of your project, expanding <b>Deploy Configurations</b> and choosing <b>Deploy local Qt libraries</b>. Make sure the <b>Use local Qt libraries</b> check box is also ticked.</p>
<a name="plugins-and-imports-special-considerations"></a>
<h2>Plugins and Imports Special Considerations</h2>
<p>If an application uses plugins or imports that depend on other modules, these modules have to be listed in the application's dependencies. This is because Qt Creator does not know ahead of time which imports or plugins your application will end up loading.</p>
<p>For example, if your application's QML code imports Qt Multimedia, then the Qt Multimedia module must explicitly be made a dependency of the application. You can do this by adding it to the application .pro file:</p>
<pre class="cpp">QT <span class="operator">+</span><span class="operator">=</span> multimedia</pre>
<p>It is also possible to manually enable dependencies on Qt libraries by opening the <b>Run</b> settings of your project, expanding <b>Package configurations</b> and selecting the <b>Libraries</b> tab. Manually check the libraries that are dependencies of your project.</p>
<a name="opengl-special-considerations"></a>
<h2>OpenGL Special Considerations</h2>
<p>Qt for Android provides two separate platform plugins: One which is suited for traditional widget-based apps that do not require OpenGL support, and one which will be used when OpenGL is required. When building and deploying your app, Qt Creator will detect whether the OpenGL-enabled plugin is required by checking if your app depends on either the Qt OpenGL module or the <a href="whatsnew51.html#qt-quick">Qt Quick</a> module.</p>
<p>There are some special considerations to be made when the OpenGL-enabled platform plugin is in use. The plugin only supports full screen top-level windows. This means that even dialogs and popups will be shown as full screen. There may also be drawing errors if you try to stack windows that have animations or otherwise require updating their UI while they are obscured by another window.</p>
<p>It is recommended that you try to avoid multiple top-level windows in the case of Android apps, as there is no traditional window system on this platform.</p>
<p><b>Note: </b>Embedding a QGLWidget inside a widget hierarchy is not supported. When QGLWidget is in use, it must be the top-level widget.</p><a name="assets-file-system"></a>
<h2>Assets File System</h2>
<p>Qt for Android provides a special, virtual file system which is based on the <i>assets</i> mechanism in Android. Files that are put under <i>assets</i> in the <i>android</i> folder created by Qt Creator, will be packaged as part of your application package. These can be accessed in Qt by prefixing the paths with <tt>assets:/</tt>. For instance, to access the image <i>logo.png</i> in the folder <i>assets/images</i>, you can use <tt>QPixmap(&quot;assets:/images/logo.png&quot;)</tt>.</p>
<p>If using the assets mechanism is not required for your app, the recommended way of distributing resources with your Qt app is to use the Qt Resource System, which is a cross-platform mechanism for distributing resources with your app.</p>
<a name="supported-architectures"></a>
<h2>Supported Architectures</h2>
<p>Qt for Android currently has binaries for ARMv7 and x86. Make sure you select the correct architecture for the device or emulator you are targeting, otherwise your application will crash. The MIPS archictecture is currently not supported by Qt.</p>
<p>If you want to support several different architectures in your application, the recommendation is to build separate APKs for each architecture, so that each APK only contains the binaries required for the targeted architecture. For more information about this, see the Android documentation about <a href="http://developer.android.com/google/play/publishing/multiple-apks.html">Multiple APK Support</a>.</p>
</div>
<!-- @@@platform-notes-android.html -->
<p class="naviNextPrevious footerNavi">
</p>
</div>
</div>
</div>
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      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.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>