QNimate

  • CoursesVideos
  • WP PremiumPlugins
  • DemosLab
  • Home
  • QIdea
  • QTrack
Home Carbon Ads Find Internet Connection Type Using Intel XDK

Find Internet Connection Type Using Intel XDK

This post is a part 8 of Intel XDK Complete Tutorial post series.

Here is the JavaScript code snippet to find the Internet connection type in an Intel XDK app.

        document.addEventListener("intel.xdk.device.connection.update",function(){
            if(intel.xdk.device.connection == "ethernet")
            {
                //ethernet
            }
            else if(intel.xdk.device.connection == "wifi")
            {
                //wifi
            }
            else if(intel.xdk.device.connection == "cell")
            {
                //cell
            }
            else if(intel.xdk.device.connection == "none")
            {
                //no internet is available
            }
            else if(intel.xdk.device.connection == "unknown")
            {
                //determining connection type. Till now its unknown. You should check for it later again.
            }
            else
            {
                //some other connection type.
            }
           
            alert(intel.xdk.device.connection);
        },false);
        intel.xdk.device.updateConnection();
Nov 5, 2014Narayan Prusty
Preventing Device From Sleeping Using Intel XDKRetrieve Device Information Using Intel XDK
Comments: 10
  1. Wahdat
    6 years ago

    Hii narayan …i am getting in to trouble and here no one is going to help me other than u ..here are some problems
    When i launch my app using intel xdk..its not scrolling down on my samsung device but on other devices…
    And why my app is working without internet internet
    I want my app should work on internet…hope will get reply soon

    ReplyCancel
  2. Anil Kumar GN
    6 years ago

    Hi Narayan This code is working fine for me but the problem is when i add device plugin backbutton code is not working properly can you please tell me the solution for this issue. Thanks in advance

    ReplyCancel
    • Wahdat
      6 years ago

      Hii anil can u help me
      U tell me plz where u write the above code in main html file or anywhere

      ReplyCancel
  3. Renjitha
    7 years ago

    but It seem to be working fine in Intel XDK App Preview…I build an apk file for the project..not working. Please help….

    ReplyCancel
  4. Felipe Perez
    7 years ago

    this function “intel.xdk.device.connection” not work in my android device. do you have solution?

    ReplyCancel
    • Narayan Prusty
      7 years ago

      Make sure you have included the device Intel XDK plugin. And also please call this function in an event handler. Tell me if it works now.

      ReplyCancel
      • bhanu
        6 years ago

        Hi Narayan ,can u please tell me the event handler function where it is located ?
        Thanks In Advance

        ReplyCancel
        • bhanu
          6 years ago

          got it!

          ReplyCancel
          • Muhammad Kamran
            5 years ago

            Kindly tell me where its located ?

            ReplyCancel
        • Wahdat
          6 years ago

          Will u plz tell me how to implement above code …thanks

          ReplyCancel

Leave a Reply to bhanu Cancel reply

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

Narayan Prusty

I am a software engineer specialising in Blockchain, DevOps and Go/JavaScript. This is my personal blog where I write about things that I learn and feel interesting to share.

7 years ago 10 Comments Cordova
Share this
0
GooglePlus
0
Facebook
0
Twitter
0
Linkedin
Related Articles
  • Find Internet Type using HTML5 Network Information API
  • Detect Shake using JavaScript
  • Using Intel XDK Find if App is Running in Emulator or Device
  • Retrieve Viewport Height and Width In Intel XDK
  • Uploading Files and Showing Progress using Intel XDK
Our Sponsor
My Books

2014 - 2015 © QNimate
All tutorials MIT license