phonegap connection check