What is the proper way to test whether the phone can make a network connection? Just doing the following?:

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)