Using the bar-descriptor.xml file
Every BlackBerry 10 application is packaged in a .bar file that is deployed to a device or simulator. The bar-descriptor.xml, specifies parameters for identifying, installing, and running applications on the BlackBerry 10 OS and is also used to specify permissions. You can configure the appearance and behavior of your application by specifying properties and values in the bar-descriptor.xml file. When you build your application, the bar-descriptor.xml file is automatically included in your .bar file.
The root element in the bar-descriptor.xml file is <qnx>. You must nest all other XML elements within this element.
You can view the bar-descriptor.xml file for your own project by expanding the project in the Project Explorer, and double-clicking the bar-descriptor.xml file. You can switch pages by clicking the tabs at the bottom of the editor. Within the file, you can enable features by setting options from the General page, Application page, Assets page, and Localization page, or by directly modifying the bar-descriptor.xml options on the Source page.
For details about the individual configuration settings, see Configure application packaging in the bar-descriptor.xml in the QNX Momentics IDE User's Guide.
The General page shows the content that's applicable to all build configurations for a project.
The Application page maintains the attributes for the application entry point. Because you can localize the entry point name, description, icon, and splash image, they appear in a detail view that's determined by your language selection on the Localization page.
This page also allows you to specify permissions that are required for accessing certain features on the device, such as the camera or file system. To learn about the permissions that you can specify, see App permissions.
You can also specify app icons and splash screens for BlackBerry 10 devices with different resolutions.
The Assets page lets you manage the assets packaged in the application's .bar file. Assets can be configuration-specific, meaning that different build configurations (Device-Debug, Device-Release, or Simulator-Debug) can use a unique set of assets. If the Assets tab does not include configuration-specific data, it will display warning annotations to indicate this.
The Localization tab shows the options for localization support.
In the Language section, when you click Add, the Add Localizations drop-down list includes all of the locales supported by the BlackBerry 10 OS. The simplest mode of operation is one that is untranslated (Default language), in which you type the name, description, or image asset path without selecting a language. In the bar-descriptor.xml file, this generates an element such as <name> that contains a single string. For translated content, you specify the text or asset for each language annotated by the language code. The result in the bar-descriptor.xml file looks like the following for US English and German:
<name> <text xml:lang="en_US">...</text> <text xml:lang="de_DE">...</text> </name>
The Source tab provides a text editor to access the contents of the bar-descriptor.xml file for advanced editing. You can copy and paste options from external sources, and access elements that aren't displayed on the General, Application, Assets, and Localization tabs (such as comments). When you require specific configuration details, the Source tab provides full access to the bar-descriptor.xml file.
The Source tab offers syntax highlighting, content assist (based on the XML schema), validation, and problem markers and annotations. The Source tab is automatically synchronized with the contents of the other tabs. For more details, see The application descriptor file DTD.