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.
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.
Written by Sebastian Bauer
Comment : 1 Comment »
Categories : Adobe® AIR™
Trackbacks : No Trackbacks »






Trackbacks
No Trackbacks