/usr/share/qt5/doc/qtdoc/android3rdpartylibs.html is in qt5-doc-html 5.3.2-3.
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 | <?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" />
<!-- android.qdoc -->
<title>Third-party Android Libraries | QtDoc 5.3</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.3</a></li>
<li>Third-party Android Libraries</li>
<li id="buildversion">
Qt 5.3.2 Reference Documentation</li>
</ul>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<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>
<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 <tt>Google Play Services</tt> 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>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>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 <tt>Android Package Source Directory</tt>. This can be any directory which is pointed to by the <a href="../qmake/qmake-manual.html#qmake">qmake</a> variable <tt>ANDROID_PACKAGE_SOURCE_DIR</tt>.</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 <tt>Android Package Source Directory</tt> and place the <tt>AndroidManifest.xml</tt> file inside it. Copy the library project directory into this directory.</p>
<p>For example, once it has been installed via the <tt>Android SDK Maintenance</tt> application, the <tt>Google Play Services</tt> library project is located under the path <tt>$ANDROID_SDK_ROOT/extras/google/google_play_services/libproject/google-play-services_lib</tt>. If the <tt>Android Package Source Directory</tt> of our project is <tt>$PROJECT_ROOT/android</tt>, then we can copy the <tt>google-play-services_lib</tt> directory in there, creating <tt>$PROJECT_ROOT/android/google-play-services_lib</tt>.</p>
<a name="adding-the-library-to-the-project-dependencies"></a>
<h2>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 <tt>project.properties</tt> file. Create a file called <tt>project.properties</tt> inside the <tt>Android Package Source Directory</tt> and add a line to it which assigns the relative path of the library project to the property <tt>android.library.reference.1</tt>. 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 <tt>$PROJECT_ROOT/android/project.properties</tt> 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>Deployment</h2>
<p>And that's it: Provided that the path referenced in the <tt>project.properties</tt> file is located under the <tt>Android Package Source Directory</tt>, the deployment tool will copy it into the packaging directory and perform the necessary steps to include it in your <tt>APK</tt>. 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> 2014 Digia Plc and/or its
subsidiaries. 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> 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. </p>
</div>
</body>
</html>
|