Improved Android connectivity check