One feature that I was more useful in Adobe AIR, was the addition of an API designed to make better automatic update of my application. This can be very important because not all users have the time (or desire) to return the application site to download the latest version.
This is already routine for operating systems and software that we use in day-to-day as the Mozilla Firefox and Google Chrome or TweetDeck.
Manage updates and can be tricky, AIR update framework has the API’s necessary for you to do this in a practical and functional. The developer can, for example:
- Periodically checking for updates based on an interval or at the request of the user
- Downloading AIR files (updates) from a web source
- Alerting the user on the first run of the newly installed version
- Confirming that the user wants to check for updates
- Displaying information on the new update version to the user
- Displaying download progress and error information to the user
The information is derived from XML files where you say that the latest version of software, new version of the news etc. Let’s take a practical example, if you use Flash Builder should already have the files applicationupdater.swc and applicationupdater_ui.swc as a reference in the library.
We started by calling xml updateConfig.xml, that “say” to your application where are the files to update.
It must be saved in the same directory of your application, along with other xml and swf files. Now in Flex, instantiate the class ApplicationUpdateUI and setting the configuration xml file so that Flex can know where is the update.
var appUpdater:ApplicationUpdaterUI = new ApplicationUpdaterUI();
appUpdater.configurationFile = new File(“app:/updateConfig.xml”);
//appUpdater.updateURL = ” http://example.com/updates/update.xml”;
//appUpdater.delay = 1;
The file updateDescriptor.xml is where you set the version in the update of your application and where you can add a description of the news update.
Basically that’s it, we will only implement the call to open the application, it checks if there is update.
I created a second version of my test application for demonstration, we have the following result:
If you want to see if there are any updates of the application, just click on “check for upadates. The updated file is downloaded and installed.