Testing connection in phonegap