Check Connection

    For App Inventor classic version, please scroll down.

    Checking connection is very easy. You can use a Web component and try connecting to a website. Google.com is a very good candidate for that since it's very unusual for google server to be down. Below is a snippet where I have a button and when you click the button, it tries to connect to google.com. You can download the source and try changing the google url to something that doesn't exist and see the result. Say if you set the value of the variable googleUrl to http://www.google.com/1234/5678, you will have a 404 error. If the responseCode sent from the server is 200, that means you have connection. For a list of response codes and what they mean, see HTTP status codes.



You can get the project file CheckConnection.aia from Downloads section as usual and try it for yourself.



Check Connection using App Inventor Classic

    Checking connection is very easy. You can use a Web component and try connecting to a website. Google.com is a very good candidate for that since it's very unusual for google server to be down. Here's a snippet where I have a button and when you click the button, it tries to connect to google.com. If the responseCode sent from the server is 200, that means you have connection.

Connection checking with app inventor


You can get the project file CheckConnection.zip from Downloads section as usual and try it for yourself.

Comments