/usr/share/qt5/doc/qtdoc/android3rdpartylibs.html is in qt5-doc-html 5.5.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <?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>Third-party Android Libraries | Qt 5.5 </title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<ul>
<li><a href="index.html">Qt 5.5</a></li>
<li>Third-party Android Libraries</li>
<li id="buildversion">Qt 5.5.1 Reference Documentation</li>
</ul>
</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="#prerequisites">Prerequisites</a></li>
<li class="level1"><a href="#including-the-library-in-the-source">Including the Library in the Source</a></li>
<li class="level1"><a href="#adding-the-library-to-the-project-dependencies">Adding the Library to the Project Dependencies</a></li>
<li class="level1"><a href="#deployment">Deployment</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Third-party Android Libraries</h1>
<span class="subtitle"></span>
<!-- $$$android3rdpartylibs.html-description -->
<div class="descr"> <a name="details"></a>
<p>This guide describes how to include a Java-based third-party library in your application package. There are many Java libraries which provide APIs that may be useful to your application. One example is the <code>Google Play Services</code> add-on provided in the Android SDK. We will use this library as an example in this guide, but the same approach may be taken to include other libraries, provided that they have been made to be included as library projects in an Android application.</p>
<a name="prerequisites"></a>
<h2 id="prerequisites">Prerequisites</h2>
<p>This guide assumes that the <a href="deployment-android.html#androiddeployqt">androiddeployqt</a> tool is used for constructing the deployment package. When using Qt Creator for building and deploying, androiddeployqt is used behind the scenes, so this also applies to development with Qt Creator. Explaining how to access the Java APIs after they have been included in the application is not in the scope of this guide.</p>
<a name="including-the-library-in-the-source"></a>
<h2 id="including-the-library-in-the-source">Including the Library in the Source</h2>
<p>The very first thing we need to do is to copy the actual library project into the source of our project. We want the contents of the library project to be copied without modifications into the packaging directory, so we need to place it into the <code>Android Package Source Directory</code>. This can be any directory which is pointed to by the <a href="../qmake/qmake-manual.html#qmake">qmake</a> variable <code>ANDROID_PACKAGE_SOURCE_DIR</code>.</p>
<p>If you are using Qt Creator, you can quickly set up the directory structure by clicking on the <b>Create AndroidManifest.xml</b> button in the <b>Deployment</b> settings of your project. This will create an <code>Android Package Source Directory</code> and place the <code>AndroidManifest.xml</code> file inside it. Copy the library project directory into this directory.</p>
<p>For example, once it has been installed via the <code>Android SDK Maintenance</code> application, the <code>Google Play Services</code> library project is located under the path <code>$ANDROID_SDK_ROOT/extras/google/google_play_services/libproject/google-play-services_lib</code>. If the <code>Android Package Source Directory</code> of our project is <code>$PROJECT_ROOT/android</code>, then we can copy the <code>google-play-services_lib</code> directory in there, creating <code>$PROJECT_ROOT/android/google-play-services_lib</code>.</p>
<a name="adding-the-library-to-the-project-dependencies"></a>
<h2 id="adding-the-library-to-the-project-dependencies">Adding the Library to the Project Dependencies</h2>
<p>Once the library code has been copied into the project, we need to tell the Android build system about it. This is done in the <code>project.properties</code> file. Create a file called <code>project.properties</code> inside the <code>Android Package Source Directory</code> and add a line to it which assigns the relative path of the library project to the property <code>android.library.reference.1</code>. If you want to include multiple library projects, increment the counter at the end of the property name for each.</p>
<p>In our example, we would create <code>$PROJECT_ROOT/android/project.properties</code> and add the following contents:</p>
<pre class="cpp">android<span class="operator">.</span>library<span class="operator">.</span>reference<span class="operator">.</span><span class="number">1</span><span class="operator">=</span>google<span class="operator">-</span>play<span class="operator">-</span>services_lib<span class="operator">/</span></pre>
<a name="deployment"></a>
<h2 id="deployment">Deployment</h2>
<p>And that's it: Provided that the path referenced in the <code>project.properties</code> file is located under the <code>Android Package Source Directory</code>, the deployment tool will copy it into the packaging directory and perform the necessary steps to include it in your <code>APK</code>. You can now add Java code to your application which accesses the APIs provided by the library project.</p>
</div>
<!-- @@@android3rdpartylibs.html -->
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2015 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>
|