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

Adobe AIR Development

Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Display app.xml versionNumber in application

At some point, you wil probably display some kind of alert to show some informtion about the application.  Besides the name of the application, copyrights, web address and possible email address, you may want to display the applications version.  One way is to extract the versionNumber that is the application's XML (*-app.xml) file.  To do this, simply:


var app_xml : XML = NativeApplication.nativeApplication.applicationDescriptor;
var ns      : Namespace = app_xml.namespace();
var alert : AlertDialog = new AlertDialog();
alert.title = 'About';
alert.dialogSize = DialogSize.SIZE_MEDIUM;
alert.message = 'Circle Application\nCircle LLC | www.drawcircles.com\n© 2010-11. All Rights Reserved.\n'
+ 'Version: ' + app_xml.ns::versionNumber + '\n\n';
alert.addButton( 'OK' );

 And NativeApplication can be found in:

import flash.desktop.NativeApplication;


Posts: 229
Registered: ‎08-14-2009
My Device: Bold 9900, DevAlpha A
My Carrier: Vodafone DE

Re: Display app.xml versionNumber in application

Hey john thanks for this Smiley Happy very usefull.
Willy R.
If my post solved your problem, make it easier for others to find by Accepting it as a solution or provide a Kudo if it was helpful for you. Thanks.