How to check internet connection in Sketchware?

To check internet connection in your Sketchware android project, follow the steps given below.

1. In your Sketchware project, add a new RequestNetwork component network.
 2. In onCreate event or in the event when you want to check internet connection, use the block RequestNetwork start network request to method GET to url http://google.com with tag A, as shown in image below.

 3. Add event RequestNetwork onResponse, and here Toast the message "Connected to Internet" or do other things when user is connected.
 4. Add event RequestNetwork onErrorResponse, and here Toast the message "Not Connected to Internet" or do other things when user is not connected.

5. Save and run the project.

Comments

  1. Not working now

    Please help

    ReplyDelete
  2. How can make button for refresh stauts again if change from offline to on line

    ReplyDelete
    Replies
    1. Put the Block "Check" and the "if..else.." block after that, in webview onPageStarted or webview onPageFinished.

      Delete
  3. Pls help me that how to refresh webview in sketchware...pls I really need plss.....reply

    ReplyDelete
    Replies
    1. WebView loadUrl (webview getUrl).

      Delete
    2. bro give me code that you write your video .make a video that enable full screen on youtube with Internet checker

      Delete
  4. this code is not working for me please help

    ReplyDelete
  5. It works, nice tutorial. Thanks, Bro

    ReplyDelete
  6. Not working java.io exeptio cannot run program ping error 13 permisio denied how to solve

    ReplyDelete
  7. why make it so complicated? Just use request network

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. How can I open new window when no internet???

    ReplyDelete

Post a Comment

Popular posts from this blog

A Flash Light App in Sketchware

Create Music Player app in Sketchware

In Sketchware: How to create a calculator for any simple formula?

Simple car racing android game in Sketchware

Firebase auth in Sketchware for Login Activity