I am running the sample Gears GeoLocation Page from Android browser
and it does not work.

It gives an error saying "Page does not have permission to access
location information using Google Gears"

I look at the settings, "Enable Gears" is turned on
nothing happens when I click on Gears Settings with in the "settings
menu".

Has anyone tried this successfully ? Basically the ability to grab
location data from javascript in Android?

<html>
<head>
<title>Hello World Geolocation</title>
<link rel="stylesheet" type="text/css" href="sample.css">
</head>
<body>

<h1>Gears Geolocation Demo</h1>
<div id="view-source">&nbsp;</div>

<p id="status"></p>

<p><b>This page demonstrates basic usage of the Geolocation API.</b></
p>

<!-- ====================================== -->
<!-- End HTML code.  Begin JavaScript code. -->

<script type="text/javascript" src="../gears_init.js"></script>
<script type="text/javascript" src="sample.js"></script>
<script>

init();

function init() {
  if (!window.google || !google.gears) {
    addStatus('Gears is not installed', 'error');
    return;
  }

  addStatus('Getting location...');

  function successCallback(p) {
    var address = p.gearsAddress.city + ', '
                  + p.gearsAddress.region + ', '
                  + p.gearsAddress.country + ' ('
                  + p.latitude + ', '
                  + p.longitude + ')';

    clearStatus();
    addStatus('Your address is: ' + address);
  }

  function errorCallback(err) {
    var msg = 'Error retrieving your location: ' + err.message;
    setError(msg);
  }

  try {
    var geolocation = google.gears.factory.create('beta.geolocation');
    geolocation.getCurrentPosition(successCallback,
                                   errorCallback,
                                   { enableHighAccuracy: true,
                                     gearsRequestAddress: true });
  } catch (e) {
    setError('Error using Geolocation API: ' + e.message);
    return;
  }

}
</script>
</body>
</html>
~
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to