It is a common occurrence for mobile applications to connect to the Internet at some point or another. For many, it will be for simple tasks, such as submitting a user's score or posting to a social network site. More sophisticated apps may attempt, for example, to aggregate data from various sources or even stream video from a Flash Media Server.
It is good practice to check that the device has an active Internet connection before trying to send or receive data. If an active connection cannot be found, then the app can adjust accordingly. For example, a game may hide its online leaderboards and remove any facilities for uploading scores.
This recipe will show you how to use AIR's URLMonitor
class to check for the availability of an URL before calling it.