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
Contributor
Posts: 19
Registered: ‎03-19-2012
My Device: playbook
My Carrier: movistar

APIs to access bar-descriptor.xml?

Hi.. Is there APIs to access bar-descriptor.xml? I'd like to add some parameters for my app. Is the file included in the final .bar?

 

Thanks.

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: APIs to access bar-descriptor.xml?

No, an application's directory is read-only. You can't edit the bar-descriptor.xml after exporting a release bar and installing it on a device.
---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Highlighted
Contributor
Posts: 19
Registered: ‎03-19-2012
My Device: playbook
My Carrier: movistar

Re: APIs to access bar-descriptor.xml?

Hi thanks for the reply. I actually only need to read the bar-descriptor.xml file, to retrieve parameters that are added from the IDE or whatever they use. So it's probably not even a filesystem read, just access to wherever the data is stored (since I assume the file is read anyways when the app starts). I'm wondering if there's APIs to read those values without having to roll my own xml parser.

New Contributor
Posts: 6
Registered: ‎12-13-2011
My Device: Playbook
My Carrier: .

Re: APIs to access bar-descriptor.xml?

use POSIX file API's and libxml2 (included in NDK)

the bar-descriptor.xml file is located within the application sandbox at:

 

$cwd/app/native/bar-descriptor.xml

 

where $cwd is the current working directory - you can use the function "getcwd()" for that.

you will need to link against libxml2 - then you should have everything you need Smiley Happy

// Aaron Ardiri
Mobile 1UP - mobile games
http://www.mobile1up.com/