O'Reilly logo

Beginning Adobe® AIR™: Building Applications for the Adobe Integrated Runtime by Rich Tretola

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

B.8. Chapter 13 Exercise

This exercise asked you to create a simple application and then integrate both the ConnectionManager and UpdateManager classes that I have provided within the AIR Central section of http://blog.everythingflex.com.

Listing B-12 shows the ConnectionManager class. The constructor of the ConnectionManager class accepts three optional arguments. The first is a Boolean, which, when true, will show the Alert message; when a connection failure occurs, it defaults to True. The second is the URL that the ConnectionManager will attempt to connect to. It defaults to www.google.com. The last is a string that holds the Alert message. It defaults to "This application requires an Internet connection." The ConnectionManager has a public property named isConnected, which will hold the current status of the application. To use the ConnectionManager, you will simply need to create an instance of the ConnectionManager class and set any of the optional arguments. Once an instance is created, it will create an instance of the URLMonitor, which will announce any changes in status and set the isConnection property to True or False.

Listing B-13 shows the UpdateManager class. The UpdateManager examines the applicationDescriptor property of the NativeApplication.nativeApplication to determine the version of the installed application. This is then stored in the currentVersion property. The constructor accepts one required argument and one optional argument. The first required argument ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required