Reading Application Information in HTML based AIR Applications

07 08 2009
So here it is, my first real post on my new blog. Hope you enjoy!

Adobe® AIR™ offers a lot of great features. However, developers, building AJAX-only applications using HTML and JS often may suffer from the lack of documentation. The AIR API reference for JavaScript developers is mostly complete in term of AJAX developing AIR apps but also lacks some common features.

This is an issue which may point to the fact that most AIR applications will be developed using Flex/ActionsScript. Since I develop a large application in JavaScript and HTML I had to solve some issues and more so I'll share this knowledge with you ;-)

My first posting leads me to a simple but useful snippet which allows you to read application information stored in AIR's application descriptor. For example if you need to reference the version of your application somewhere in your code, you can use my construct.


So what do we do here? The job is quite simple: first we retrieve the application descriptor, which is already loaded by the AIR framework and is available to you from the current NativeApplication instance. The applicationDescript property is a string containing the whole XML structure. So at this point we simply load the string into a new DOMParser and evaluate our required values.

The appInfo object of this construct has only read-only properties. If you need more information out of the application descriptor, this appInfo object can be easily extended.

Bookmark Reading Application Information in HTML based AIR Applications  at del.icio.us Digg Reading Application Information in HTML based AIR Applications Mixx Reading Application Information in HTML based AIR Applications Bloglines Reading Application Information in HTML based AIR Applications Technorati Reading Application Information in HTML based AIR Applications Bookmark Reading Application Information in HTML based AIR Applications  at Furl.net Bookmark Reading Application Information in HTML based AIR Applications  at blogmarks Bookmark Reading Application Information in HTML based AIR Applications  at Ma.gnolia.com wong it! Stumble It!

Trackbacks


No Trackbacks

Comments

Display comments as (Linear | Threaded)
14 10 2009
#1 Martyn (Reply)

MartynVery useful, works perfectly, cheers!

Add Comment


Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA