Checking Internet connectivity in AIR application

Hi All,
How to check internet connected or not in AIR app.
Event.NETWORK_CHANGE only tells the change in the status,but it dosent
tell if it is disabled or enabled.
Please share if anything else can tell if internet is available.
-Sheetal.

You should also look into the service monitoring classes, especially the URLMonitor class.
For example, the following ActionScript code uses an instance of the URLMonitor class to detect connectivity changes to the Adobe website:
var monitor:URLMonitor = new URLMonitor(new URLRequest('http://www.example.com'));
monitor.addEventListener(StatusEvent.STATUS, announceStatus);
monitor.start();
function announceStatus(e:StatusEvent):void {
    trace("Status change. Current status: " + monitor.available);
Here's a JavaScript version:
var monitor = new air.URLMonitor(new URLRequest('http://www.example.com'));
monitor.addEventListener(StatusEvent.STATUS, announceStatus);
monitor.start();
function announceStatus(e:StatusEvent):void {
     trace("Status change. Current status: " + monitor.available);

Similar Messages

  • Detect wireless Internet connection in AIR application

    Hi All,
    I am facing challenges to determine whether Internet connection is available over a Wireless connection. Even if I am connected, I get the status as Not Connected.
    However the same is working absolutely find when I am connected to Wired network.
    Can any one advice how should I proceed?
    I am using the below code for tracking network connection:
         //check for network availability
         NativeApplication.nativeApplication.addEventListener(Event.NETWORK_CHANGE, onNetworkChange);
        monitor = new URLMonitor(new URLRequest('http://www.google.co.in'));
        monitor.addEventListener(StatusEvent.STATUS, announceStatus);
        monitor.start();
        requestLoader.addEventListener(Event.COMPLETE, requestCompleteHandler);
        requestLoader.addEventListener(IOErrorEvent.IO_ERROR, requestErrorHandler);              
        requestLoader.load(request);
        requestLoader.addEventListener(Event.COMPLETE, setInitStatusMsg);
    The corresponding methods have been set to set the boolean flag.
    Thanks,
    Hitesh Patel.

    Hi All,
    Thanks for your inputs.
    However I resolved the issue. The problem was with my code. I somehow missed the "requestCompleteHandler" function and hence when the request was completed the status was not refreshing. Its working fine now.
    Thanks,
    Hitesh Patel.

  • I'm unable to login to facebook though I reinstalled twice, but as i try to login it gives an error message as timeout, connection failure or check internet connection.

    Dear service provider, I'm unable to login to facebook even though i tried to uninstall and again reinstall as per the observation from the forum discussion.. but still it gives me arror as Timeout connection, or connection failure and check internet connection.. how to troubleshoot, pls suggest me..
    2ndly I'm unable to search by some of the keywords in itunes. means iTune is not fetching the required information rather it gives no result found message..

    Have you tried a hard reset of the iPod to see if that helps?  To do this, press and hold both the Sleep/Wake and Home buttons together long enough for the Apple logo to appear. 
    Otherwise, work through each of the troubleshooting suggestions in this Apple support document as necessary.
    iOS: Troubleshooting Wi-Fi networks and connections
    B-rock

  • HT204408 FaceTime on imac don't work after installing mavericks, After log in it says: check internet connection and try again.

    facetime stops working after installing mavericks. After login it says: check internet connection and try again. My internet connections are ok, I have both wifi and lan.

    Please describe in detail what happened when you took all the applicable steps in the support article. That's the starting point for any further efforts to solve the problem.

  • When I am connected to the Internet I cannot sign into FaceTime. A message comes ' not connected to server. Check Internet connection' . Am unable to contact folks on FaceTime for last 5-6 days. Please help

    Dear Friends,
    I am unable to contact my friends on FaceTime last 5-6 days. Although I am connected to the Internet and browsing my mails successfully, when I sign into FaceTime with correct ID and PW a message appears ' cannot connect to server. pl check Internet connection' this is very confusing. Pl help.
    thanks
    ARabinda Ganguly

    Make sure your time zone and time are correct. Have the iPad get the time automatically.

  • Downloading ebookstops after 3%-"error--check internet connection." Why won't ebook finish downloading?k

    Downloading ebook stops after 3% downloaded-error message appears: "check internet connection".
    Why does it stop downloadng before finished?

    I belong to a book club at the Public Library in Los Angeles.
    I am supposed to get the downloaded books (free) from their Media Library,
    (I listen when I'm out and around, or in the car- and read the actual book when I'm at home-)
    They direct users to download from an engine (?) called OverDrive.com, or OverDriveMedia.com.
    There are lots of books free of charge.
    Thanks for your response.
    norazg

  • Cannot connect to iTunes store. Says check internet connection. Connection is good.

    Cannot connect to iTunes store. Says check internet connection. Connection is good.

    Hi JHersh305,
    Check out this article for issues connecting to the iTunes Store.  There's a section for Windows.
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    Thank you for visiting Apple Support Communities.
    Nubz

  • "Connection error. Check Internet connection." when trying to Enable Web Services on HP 1606dn

    Error message "Connection error. Check Internet connection." when trying to Enable Web Services on HP Laserjet 1606dn.
    Operating system: Windows 7
    Thanks for helping,
    Howard
    UPDATE 21-7-13: After upgrading the firmware to the lastest version, I could enable web services. Big help was this video: http://www.youtube.com/watch?v=Q5gpIGZXDXw
    This question was solved.
    View Solution.

    Hi,
    Please try the following.
    1. Open an internet browser type printer's IP address.
    2. Should bring you to the printer's status page.
    3. Select the networking tab at the top.
    4. Left hand side select IPv4 under wireless.
    5. Under DNS address Configuration select Manual DNS Server.
    6. For Preferred enter 8.8.8.8
    7. For Alternate enter 8.8.4.4
    8. Select apply. You might get a warning saying this could interrupt connection that's fine.
    9. Turn printer off for about 30 seconds then try again.
    Although I am an HP employee, I am speaking for myself and not for HP.
    --Say "Thanks" by clicking the Kudos Star in the post that helped you.
    --Please mark the post that solves your problem as "Accepted Solution"

  • I have downloaded itunes but i cannot connect to the itunes store, it says check internet connection, i am browsing other sites so i know i am online

    Every time i try and go to the itunes store i get a message saying cannot conect to itunes store, check internet connection, but i am browsing so am already connected to the internet?
    what can i do?

    1.Power Cycle
       Power off the router. Unplug it from the wall. Wait a while.
       Plug it back to the wall. Power the router on. Wait until all the lights are lit properly.
       It will take a while.
      Restart the computer.
      Start up in Safe Mode.
       http://support.apple.com/kb/PH11212?viewlocale=en_US
    2.  Turn off Extensions, if any.
         Safari > Preferences > Extensions
    3. Turn off proxies, if selected.
         System Preference > Network > Advanced  > Proxies Tab
         Under "Select Protocol", uncheck any box if selected.
         Click "OK" then  "Apply"
    4. Uninstall anti-virus software, if any.
    5. A new Mac comes with 90 days of free tech support from AppleCare.
        AppleCare: 1-800-275-2273

  • "itunes update server could not be contacted, check internet connection or try again later"  I've been trying for several days now :p  Help

    I keep getting this, "can not contact itunes server, check internet connection." every time I try to update itunes. Well, the connection is good.  

    A simple search of the forums would have revealed many similar threads with the same error and appropriate troubleshooting and resolution.
    See the "More Like This" section over there =================>

  • Web Services problem - Connection error. Check Internet connection. - 1102w

    Hello!
    When i try to enable Web Services Setup i get  "Connection error. Check Internet connection." error message. I tried to do manual and automatic IP Address Configuration.
    Picture:
    If you have any idea what should i do, please help me!
    Thank you!
    Benyke

    I did the firmware update utility.  Says my firmware is up to date.  Still get error.

  • HP Web Services Setup - Connection error. Check Internet connection.

    I am trying to enable HP Web Services but Connection error. Check Internet connection. .
    I use static ip with Preferred DNS Address: 8.8.8.8 and 8.8.4.4 and it does not work.
    I changed to DHCP also it does not work.
    I have a ZTE home modem router connected to the printer.
    This question was solved.
    View Solution.

    Hi MaBek,
    Can you check if your printers IP address is valid.
    If you have a laptop or PC connected to the same network, open a browser and type the IP address in the address bar and hit enter. 
    This should open a Embedded web Server page if the IP address is valid.
    Here you can navigate to Web Services tab and click on enable to enable web services.
    Regards,
    Oliver
    "Although I work for HP, I'm speaking for myself and not on behalf of HP"--Please mark the post that solves your problem as "Accepted Solution"
    "Say "Thanks" by clicking the Kudos Star in the post that helped you.

  • I keep getting check internet connection errors when uploading to YouTube. Why?

    I created a keynote presentation with audio and pictures with some animation of words.  I am trying to upload it to YouTube through the share button.  It takes a couple minutes to "process the video". Once that reaches completion an error message (yellow triangle with a tiny keynote icon) pops up saying unable to upload. Check internet connection and try again.  I've tried again and again and again getting closer to my router.   I am using my MacBook Pro Yosemite and recent update of keynote.  My file is around 40mb.  Why won't it upload?

    There has been an outage for both iMessage and FaceTime today.  Started at around Noon time, PDT.
    There is nothing you can do from your end, this problem is on Apple's servers.
    Click below for Apple's System Status:
    http://www.apple.com/support/systemstatus/

  • HT204266 Cannot access itunes store from itunes - says to check internet connection.  I have internet connection.  I've unistalled ALL itunes files and associated files, and reinstalled?

    Cannot access itunes store from itunes - says to check internet connection.  I have internet connection.  I've unistalled ALL itunes files and associated files, and reinstalled?

    Try this:
    1. Settings>General>Date & Time>Turn off set automatically
    2. Set date one year ahead
    3. Go back to iTunes and try again.
    4. You will get the same error.
    5. Go back to settings general date and time and turn back on 'set automatically'
    Try connecting to iTune Store again.

  • My "Shop Local" app won't open, says; Checking internet connection

    I downloaded the app; "Shop Local"  and it all went fine, but when I tap "ok"  it says "checking internet connection".  All of my other apps work, fine no problem.  How can I get this to work??
    I tried deleting it but it reloads from the cloud and I guess I can't start from fresh.

    Is this the app? https://itunes.apple.com/us/app/shop-local/id475372575?mt8
    I notice that it was released in Nov. of 2011 and has never been updated (appears to have been designed for iOS 3), plus has a fair number of negative reveiws. The support site appears to be a dead end. If this is the app, I'd recommend deleting it and finding another one.

Maybe you are looking for

  • Execute a script on a remote machine - possible?

    I am sorry if this sounds silly - what I would like to know is if its possible for a java program executing on one machine to execute a shell script that resides on another machine. That script in turn invokes a java program which does some other stu

  • FRITZ!Box Fon WLAN 7390

    Hi All This is my first post so be gentle!! I was using my BTOpenreach modem with my Draytek 2830Vn+.  Unfortunately the Draytek has now been refunded due to a fault and I'm back on my HomeHub3. After much research I have found FRITZ!Box Fon WLAN 739

  • BEX Event Issue + Vista

    I'm running Vista Home Basic SP1 on my laptop and installed iTunes v8 + QuickTime, when I execute, i get an error for iTunes & one for QuickTime Problem signature: Problem Event Name: BEX Application Name: iTunes.exe Application Version: 8.0.2.20 App

  • Do i need to delete everything from my old iphone before i get a new iphone?

    i just got a replacement iphone in the mail, i just want to make sure before i turn my old one off, do i need to delete anything from it? like photos, notes, etc... i just want to protect my privacy. thank you.

  • Where exactly does the path in Tomcat start?

    I am trying to create a jsp page that outputs a random image. The jsp page is directly in ROOT. The image files are in ROOT/img/random/. What I did was write a simple java class(not a servlet) to read the contents of random and then just randomly cho