/usr/share/qt5/doc/qtdoc/blackberryappdeploy.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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | <?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" />
<!-- blackberry.qdoc -->
<title>Deployment on BlackBerry 10 | 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>Deployment on BlackBerry 10</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="#application-packaging">Application Packaging</a></li>
<li class="level1"><a href="#blackberry-application-archive-bar-descriptor-file">Blackberry Application aRchive (BAR) Descriptor File</a></li>
<li class="level1"><a href="#blackberry-nativepackager">blackberry-nativepackager</a></li>
<li class="level1"><a href="#where-do-the-app-resources-land-on-the-device">Where do the App Resources Land on the Device</a></li>
<li class="level2"><a href="#handling-the-sand-box">Handling the Sand Box</a></li>
<li class="level2"><a href="#packaging-and-accessing-the-files">Packaging and Accessing the Files</a></li>
<li class="level2"><a href="#prefer-using-the-qt-resources">Prefer Using the Qt Resources</a></li>
<li class="level2"><a href="#viewing-the-folders-on-the-device">Viewing the Folders on the Device</a></li>
</ul>
</div>
<h1 class="title">Deployment on BlackBerry 10</h1>
<span class="subtitle"></span>
<!-- $$$blackberryappdeploy.html-description -->
<div class="descr"> <a name="details"></a>
<p>Generally, this topic is well explained in the BlackBerry 10 documentation for native application development.</p>
<a name="application-packaging"></a>
<h2>Application Packaging</h2>
<p>The page <a href="https://developer.blackberry.com/native/documentation/core/qt_package_deploy.html">Packaging, deployment and distribution</a> is a good introduction to the tools and how to use them. In short, applications are packaged in so called BAR files which are zip archives that contain additional meta-information.</p>
<a name="blackberry-application-archive-bar-descriptor-file"></a>
<h2>Blackberry Application aRchive (BAR) Descriptor File</h2>
<p>A part of this meta information is the content of the <a href="https://developer.blackberry.com/native/documentation/core/com.qnx.doc.native_sdk.devguide/topic/c_about_bar_app_descriptor_file.html">BAR application descriptor file</a> which is an XML file. This file describes the content of the package and where this content can be found. Other important meta-information is defined in this file, as well.</p>
<p>Qt Creator has an editor for the BAR application descriptor files which simplifies quite some manual editing.</p>
<p>The content of the package may also include images, sounds and any other data files used by the application in addition the the binary.</p>
<p>See <a href="https://developer.blackberry.com/native/documentation/core/com.qnx.doc.native_sdk.devguide/topic/r_blackberry_tablet_dtd_intro.html">full list of all elements in a BAR application descriptor file</a></p>
<a name="blackberry-nativepackager"></a>
<h2>blackberry-nativepackager</h2>
<p>Application packages are created by the command line tool <b>blackberry-nativepackager</b> provided in the BlackBerry 10 NDK. This tool reads a BAR application descriptor file passed as an argument and builds the application package accordingly.</p>
<p>Application packages can be built in development mode or can be built as signed packages. Development mode applications require a <b>debug token</b> and can be installed and run on any device with the same debug token as they were build with.</p>
<p>Signed packaged are usually used for publishing in BlackBerry World. They can also be installed from the command line on any device in development mode and do not need a debug token.</p>
<a name="where-do-the-app-resources-land-on-the-device"></a>
<h2>Where do the App Resources Land on the Device</h2>
<a name="handling-the-sand-box"></a>
<h3>Handling the Sand Box</h3>
<p>Each application is installed in its own home folder on a dedicated partition. Shared folders (those which contain data to be shared between apps) are mapped according to permissions requested so that the app can access them under the standard paths. An important thing to keep in mind is that all applications can access files only within the boundaries of their <i>sandboxes</i>. When the app asks to access shared data, according folders become available in app’s sandbox as well. See <a href="https://developer.blackberry.com/native/documentation/cascades/device_platform/data_access/file_system.html">Working with the file system</a> for an overview of all sub-folders for different purposes in app’s home folder.</p>
<p>Applications cannot directly access any files outside their sandboxes. Even though it is possible to package and deploy libraries with the application, it is not possible to deploy any libraries into the system folders. Applications cannot share their libraries with other applications either.</p>
<a name="packaging-and-accessing-the-files"></a>
<h3>Packaging and Accessing the Files</h3>
<p>Even though the article <a href="https://developer.blackberry.com/native/documentation/cascades/device_platform/data_access/file_system.html">Working with the file system</a> explains how the sandbox model influences file access, it might not be clear from the beginning how paths can actually be referred in the application code.</p>
<p>This line is the universal way to add any other content to the app package:</p>
<pre class="cpp"><span class="operator"><</span>asset path<span class="operator">=</span><span class="string">"<local_path_to_files>/<local_file_name>"</span><span class="operator">></span><span class="operator"><</span>on_device_path_to_files<span class="operator">></span><span class="operator">/</span><span class="operator"><</span>on_device_file_name<span class="operator">></span><span class="operator"><</span><span class="operator">/</span>asset<span class="operator">></span></pre>
<p>or even shorter:</p>
<pre class="cpp"><span class="operator"><</span>asset path<span class="operator">=</span><span class="string">"<SOURCE>"</span><span class="operator">></span><span class="operator"><</span>TARGET<span class="operator">></span><span class="operator"><</span><span class="operator">/</span>asset<span class="operator">></span></pre>
<p>Lets assume you have an app which loads an image with Qt Quick . The application code is located in the subfolder <i>test_assets</i> in your <i>projects</i> folder. The following line adds this image to the BAR application descriptor file:</p>
<pre class="cpp"><span class="operator"><</span>asset path<span class="operator">=</span><span class="string">"/Users/johndoe/projects/test_assets/qt-logo.png"</span><span class="operator">></span>qt<span class="operator">-</span>logo<span class="operator">.</span>png<span class="operator"><</span><span class="operator">/</span>asset<span class="operator">></span></pre>
<p>You also have to add QML files:</p>
<pre class="cpp"><span class="operator"><</span>asset path<span class="operator">=</span><span class="string">"/Users/johndoe/projects/test_assets/qml"</span><span class="operator">></span>qml<span class="operator"><</span><span class="operator">/</span>asset<span class="operator">></span></pre>
<p>Note that we used absolute paths in the above examples, though relative paths work, as well.</p>
<p>The key thing to know here is that the app installation folder is mapped to the folder <i>app/native</i> in the application working directory (referred by <a href="../qtcore/qdir.html#currentPath">QDir::currentPath</a>(), for example a <tt>.</tt> folder in the BAR application descriptor file maps to the <i>app/native/</i>. folder. Our app would be installed for example in:</p>
<pre class="cpp"><span class="operator">/</span>accounts<span class="operator">/</span><span class="number">1000</span><span class="operator">/</span>appdata<span class="operator">/</span>com<span class="operator">.</span>example<span class="operator">.</span>test_assets<span class="operator">.</span>testDev_test_assetscd80795f</pre>
<p>The <i>qt-logo.png</i> lands here:</p>
<pre class="cpp"><span class="operator">/</span>accounts<span class="operator">/</span><span class="number">1000</span><span class="operator">/</span>appdata<span class="operator">/</span>com<span class="operator">.</span>example<span class="operator">.</span>test_assets<span class="operator">.</span>testDev_test_assetscd80795f<span class="operator">/</span>app<span class="operator">/</span>native<span class="operator">/</span>qt<span class="operator">-</span>logo<span class="operator">.</span>png</pre>
<p>The <i>qml</i> folder will be recursively copied to</p>
<pre class="cpp"><span class="operator">/</span>accounts<span class="operator">/</span><span class="number">1000</span><span class="operator">/</span>appdata<span class="operator">/</span>com<span class="operator">.</span>example<span class="operator">.</span>test_assets<span class="operator">.</span>testDev_test_assetscd80795f<span class="operator">/</span>app<span class="operator">/</span>native<span class="operator">/</span>qml<span class="operator">/</span></pre>
<p>Our app has only one QML file which lands here:</p>
<pre class="cpp"><span class="operator">/</span>accounts<span class="operator">/</span><span class="number">1000</span><span class="operator">/</span>appdata<span class="operator">/</span>com<span class="operator">.</span>example<span class="operator">.</span>test_assets<span class="operator">.</span>testDev_test_assetscd80795f<span class="operator">/</span>app<span class="operator">/</span>native<span class="operator">/</span>qml<span class="operator">/</span>main<span class="operator">.</span>qml</pre>
<p>This QML code loads the image in <i>main.qml</i> as:</p>
<pre class="cpp">Image {
source: <span class="string">"../qt-logo.png"</span>
anchors<span class="operator">.</span>centerIn: parent
}</pre>
<p>Notice the <tt>../</tt> in the front of the file name. This is because the current folder of a Qt Quick element is where its file was loaded from. We load <i>main.qml</i> this way:</p>
<pre class="cpp"><span class="type">int</span> main(<span class="type">int</span> argc<span class="operator">,</span> <span class="type">char</span> <span class="operator">*</span>argv<span class="operator">[</span><span class="operator">]</span>)
{
<span class="type"><a href="../qtgui/qguiapplication.html">QGuiApplication</a></span> app(argc<span class="operator">,</span> argv);
<span class="type"><a href="../qtqml/qqmlapplicationengine.html">QQmlApplicationEngine</a></span> engine;
engine<span class="operator">.</span>load(<span class="type"><a href="../qtcore/qurl.html">QUrl</a></span>(<span class="type">QStringLiteral</span>(<span class="string">"app/native/qml/main.qml"</span>)));
<span class="keyword">return</span> app<span class="operator">.</span>exec();
}</pre>
<p><tt>Image</tt> assumes it is located in <tt>app/native/qml/</tt> and so needs to get one level up to get to <tt>app/native/qt-logo.png</tt>.</p>
<p>One more thing to notice: the article <a href="https://developer.blackberry.com/native/documentation/cascades/device_platform/data_access/file_system.html">Working with the file system</a> also talks about a dedicated <i>assets directory</i>. This is a bit confusing, since the <i>asset</i> XML element in the BAR application descriptor file can refer to any file, but the <i>assets</i> directory refers to the asset URI scheme in the Cascades framework. Using Cascades UI components you can load image as:</p>
<pre class="cpp">ImageView {
imageSource: <span class="string">"asset:///image.png"</span>
}</pre>
<a name="prefer-using-the-qt-resources"></a>
<h3>Prefer Using the Qt Resources</h3>
<p>Using Qt resources (via the <tt>qrc://</tt> scheme) for all small read-only files and especially for QML code files is a more preferred and convenient way! Accessing assets as files makes only sense for large read-only files or files which will be changed/created by the app.</p>
<a name="viewing-the-folders-on-the-device"></a>
<h3>Viewing the Folders on the Device</h3>
<p>In some cases, it might be needed to inspect the actual content of the folders directly on the device. You can do this in an SSH shell in the File Inspector in the Momentics IDE. The article <a href="http://qt-project.org/wiki/BlackBerry_Hints_n_Tips">BlackBerry Hints and Tips</a> shows how to use SSH with BlackBerry 10 along with a few other hints and tips.</p>
</div>
<!-- @@@blackberryappdeploy.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>
|