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.
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.
Not working now
ReplyDeletePlease help
How can make button for refresh stauts again if change from offline to on line
ReplyDeletePut the Block "Check" and the "if..else.." block after that, in webview onPageStarted or webview onPageFinished.
DeleteNot working man
DeleteWebView loadUrl (webview getUrl).
ReplyDeletebro give me code that you write your video .make a video that enable full screen on youtube with Internet checker
ReplyDeletethis code is not working for me please help
ReplyDeletefor me also
DeleteThis comment has been removed by the author.
DeleteIt works, nice tutorial. Thanks, Bro
ReplyDeleteNot working java.io exeptio cannot run program ping error 13 permisio denied how to solve
ReplyDeleteWhy error on "e.toString" ?
ReplyDeletewhy make it so complicated? Just use request network
ReplyDeletenice
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteNice work thanks
ReplyDeleteHow can I open new window when no internet???
ReplyDeletehttps://xbuzznet.com/market
ReplyDeleteIt's working with https://google.com instead of http://google.com
ReplyDeleteit always shows "not connected to the internet".
ReplyDeleteSir, can you tell me the code for turning the internet on/off using asd code. Thank you in advance 😊.
ReplyDeleteSir, can you tell me the code for turning the internet on/off using asd code. Thank you in advance 😊.
ReplyDeletePlease 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
ReplyDeletePls my Sketchware is not signing in, it's showing error when I try to log in to my Google account
ReplyDelete