Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 50
Registered: ‎05-15-2012
My Device: PlayBook
My Carrier: no provider
Accepted Solution

Access to bar-descriptor.xml from within app

Is there any way to get properties from bar-descriptor.xml? Particularly interested in the app id to make app understand whenever it is a free or paid version of the app

Highlighted
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Access to bar-descriptor.xml from within app

[ Edited ]

There are PackageInfo and ApplicationInfo classes which contain this information:

http://developer.blackberry.com/cascades/reference/bb__packageinfo.html

http://developer.blackberry.com/cascades/reference/bb__applicationinfo.html

 

To extract appId:

 

#include <bb/PackageInfo>
...

bb::PackageInfo pi; QString appId = pi.name();

Add LIBS += -lbb  to .pro file 

 

You can also parse the file manually, these threads contain more info on how to locate it:

http://supportforums.blackberry.com/t5/Native-Development/Extract-version-number-from-bar-descriptor...

http://supportforums.blackberry.com/t5/Native-Development/APIs-to-access-bar-descriptor-xml/m-p/1737...

 


Andrey Fidrya, @zmeyc on twitter