The beauty of Adobe AIR is it enables to develop and deploy a Rich Internet Application (RIA) on the desktop. But one interesting scenario which develops when deploying a RIA on the desktop is, how will the application know, if the internet connection is currently available? How to enable run time handling of the application based on the availability of the Internet Connection?
AIR SDK answers all this by providing the developer with the URLMonitor Class. This class which is included in the ServiceMonitor.swc file, provides properties and methods to handle changes in the Internet Connection. The following steps explain, how to make efficient use of the URLMonitor class to check the availability of the Internet Connection.
Step 1: To access the properties and methods of the URLMonitor class we will have to import the air.net.URLMonitor class
import air.net.URLMonitor;
Step 2: Create an object of URLMonitor class.
private var monitor:URLMonitor;
Step 3: Create an URLRequest object and to the constructor pass the URL you wish to be requested
private var myURL:URLRequest = new URLRequest(“http://www.adobe.com”);
Step 4: On Creation Complete of the application, instantiate the URLMonitor object (monitor) by passing the URLRequest object (myURL) as one of the parameters
monitor = new URLMonitor(myURL);
Step 5: Start the URLMonitor by calling the method start()
monitor.start();
Step 6: Add an event listener where the event is of type Status. This indicates that the service status has changed.
monitor.addEventListener(StatusEvent.STATUS, on_Connection);
Step 7: Now the last and the final step. In the filter function on_Connection(event:Event), check if the Internet Connection is available by checking the boolean value of the property “available”.
Filed under: Uncategorized | Leave a Comment
Filed under: Uncategorized | Leave a Comment
Tags: Cold Fusion, date, null values
Flex applications can more often than not be divided into two broad categories:
1) Applications built around a very specific design
2) Applications built with data at the core
Flex 4 provides great new features which addresses both styles of application development. For the first set of applications, Flash builder 4 empowers the developers with a new Developer/Designer Workflow theme. For the second set of applications, Flash Builder 4 provides a new and exciting feature called Data Centric Development (DCD). DCD is a Rapid Application Development feature in Flash Builder 4 which is aimed to enable traditional web developers to quickly build Flex apps, which will connect to server side back ends like Cold Fusion, PHP, LCDS, BlazeDS, HTTPService and WebService.
I will not dwell into the intricacies of both the workflows in this post, as their already exist some amazing articles which completely cover the functionalities of the two features. The links to those articles are documented below,
Quick Links:
Developer/Designer Workflow theme:
1) Tutorials on Flash Catalyst and Flex 4
Data Centric Developement:
2) Build a Master-Detail Flex-Cold Fusion application without writing a line of code
3) Building Flex and LCDS based CRUD application using Flash Builder 4
4) DCD Service Wizard – PHP service
5) DCD Service Wizard – HTTPService
7) Building Flex and Java based CRUD application using Flash Builder 4
Filed under: Uncategorized | Leave a Comment
Tags: DCD, Developer/Designer Workflow, Flex
