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
  10. It's working with https://google.com instead of http://google.com

    ReplyDelete
  11. it always shows "not connected to the internet".

    ReplyDelete
  12. Sir, can you tell me the code for turning the internet on/off using asd code. Thank you in advance 😊.

    ReplyDelete
  13. Sir, can you tell me the code for turning the internet on/off using asd code. Thank you in advance 😊.

    ReplyDelete
  14. Please help me.. i used this component. My app is linked with firbase. After used this component my app scanner shows "high risk. Malware or virus. Please uninstall" why that

    ReplyDelete
  15. Pls my Sketchware is not signing in, it's showing error when I try to log in to my Google account

    ReplyDelete

Post a Comment

Popular posts from this blog

Simple car racing android game in Sketchware

Creating a Drawing View in Sketchware

Enable Fullscreen for Youtube videos in WebView

How to enable upload from webview in Sketchware?

List of Calendar Format symbols valid in Sketchware