How to Identify the gps is turned off phonegap android <p>I want to figure out the gps is turned on in android device using phonegap. </p> <p>I tried like </p> <pre><code>navigator.geolocation.getCurrentPosition(function onSuccess(position){ console.log("The gps is availabile"); }, function geolocationError(error){ console.log("The geo error : " + error.code +"code : " + PositionError.PERMISSION_DENIED); if( error.code == PositionError.PERMISSION_DENIED ){ alert("Please turn on your gps to start the trip"); }else{ console.log("Gps is turned on. but not availabile"); } },{enableHighAccuracy: true , timeout:10000 }); </code></pre> <p>But when gps is turned off i never gets the <code>PositionError.PERMISSION_DENIED</code> error. Always it shows the <code>PositionError.POSITION_UNAVAILABLE</code> . How i can identify the gps is turned on /off ?.(not the gps availabile or not)</p>