title: Best way to check for internet connection in android
body: <p>I am developing an <code>android</code> app and I want to know the best way to check if internet connection is present or not. I have tried using <code>connectivity manager</code> and <code>networkinfo</code> class but to no avail as my app keeps on crashing without net or else do I go <code>HttpConnection</code> method. Can someone give their valuable suggestions.  </p>