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
punto
Posts: 18
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.

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, 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.
Please use plain text.
Contributor
punto
Posts: 18
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.

Please use plain text.
New Contributor
mobile1up
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 :smileyhappy:

// Aaron Ardiri
Mobile 1UP - mobile games
http://www.mobile1up.com/
Please use plain text.