Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i obtain GPS location in Android Webkit or Opera Mobile 10

Well the question is in the title.

How can i obtain GPS location on a mobile device in Android Webkit or/and Opera Mobile 10?

So in iPhone Safari this is doable. How about those 2 browsers? I looked for such functionalities and found nothing. Is that doable via javascript as well?

like image 773
JohnnyNotSoBravo Avatar asked Dec 06 '25 15:12

JohnnyNotSoBravo


1 Answers

see http://html5demos.com/geo. Relevant bit of JS for HTML5 location:

if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(successCallback, errorCallback);
} else {
  error('not supported');
}

yep, it's that easy.

like image 179
Yoni Samlan Avatar answered Dec 09 '25 14:12

Yoni Samlan