Ok, so I have been looking for an adequate answer to this problem for quite some time. I have a web application that uses navigator.geolocation.getCurrentPosition to get user position.
The native browser on Samsung Galaxy devices almost always has problems with the getCurrentPosition code. I tried all sorts of variations of this code with callbacks and timeouts, but this is always the same problem. Many people have documented this problem, and some indicate that rebooting the device will work (sometimes restarting works, but not always), and the warning that users restart their device seems more ridiculous).
Has anyone understood which getCurrentPosition method to use to work with the Samsung Galaxy Device? Here is what I work with ...
<script> $(document).ready(function(){ if( navigator.geolocation ) { navigator.geolocation.getCurrentPosition( success, fail ); } else { alert("Sorry, your browser does not support geolocation services."); } function success(position) { window.location = "mobile_set_coordinates.php?user_lat=" + position.coords.latitude + "&user_lon=" + position.coords.longitude + "&accuracy=" + position.coords.accuracy; } function fail() { </script>
There is also a link to one of the discussions on the issue: https://groups.google.com/forum/#!topic/phonegap/ESrHAjFHgFU
jquery android samsung-mobile galaxy
Brandon
source share