I am trying to create a HTML5 page that will catch the geolocation, but I’m getting an error on AVD manager. It throws ‘the last location provider was disabled’ error.
i’ve heard that could go into the setting of the mobile browser and check ‘Enable Location’ to solve this problem for a real device.
well i do not know how to config the settings for a avd job. could anyone give me some guide please?
Here’s my source code:
document.addEventListener("deviceready", onDeviceReady, false);
// PhoneGap is ready
//
function onDeviceReady() {
alert('xxx');
navigator.geolocation.getCurrentPosition(onSuccess, onError);
}
// onSuccess Geolocation
//
function onSuccess(position) {
alert('xieiei');
var element = document.getElementById('geolocation');
element.innerHTML = 'Latitude: ' + position.coords.latitude + '<br />' +
'Longitude: ' + position.coords.longitude + '<br />';
}
// onError Callback receives a PositionError object
//
function onError(error) {
alert('ddd');
alert('code: ' + error.code + '\n' + 'message: ' + error.message + '\n');
}
Go to
And then check