Tweet #newtonball with a screenshot of the level to win a suprize gift.
Checkout this cool game
Newton Ball in Playstore
There are two ways in which you can use the Google Latitude API
a) Use the long way in which you will need the user to authenticate
your Google Latitude App each time you want to get his location
details, but this rather a long method to get the user's location.
Its a more generalized & accepted method of using the Google
Latitude API. The disadvantages of this method is that you can
create a vehicle tracking system or human tracking system using
this methodology since you need to follow the steps in the
OAUTH playground to authenticate your application to access the
location details .
b) Google Latitude Hack :
We hereby comeup with a simpler and a much easier method to use
Google Latitude API and we are calling it as Google Latitude
HACK since it simplifies the location tracking process & its
hardly few lines of code .
Steps for using Google Latitude Badge API .
We will call this technique as Google Latitude Badge API ,why?
Because it uses the Google Latitude + Google Badge for location
tracking purposes .
a) Log into your Google Account in which you have Google
Latitude enabled .( Enabling Google Latitude is simple
you just have to log into your Google Latitude using
any of your Google Accounts and you will automatically
enable it ).
b) Goto https://www.google.com/latitude/b/0/apps .This is
nothing but your Google Latitude Apps settings section.
c) The next step is to enable your public location badge .
In Google Public Location Badge choose the best
location badge radio button .
d) If you are following this steps using a A-GPS enabled
mobile phone , your location will displayed on the map
as shown below .
steps using a pc you may
set a static location of your
choice on Google Latitude.
For that Enable the Set My
Location Manually option
under Privacy Section in
Friends Tab .
f) So once you have followed this basic steps you are
ready to implement the location tracking system using
Google Latitude Badge API .
<?php //Replace the YOURUSERID in the url below with your Badge userid . $url="http://www.google.com/latitude/apps/badge/api?user=YOURUSERID&type=json" ; // We get the content $content = file_get_contents( $url ); // We convert the JSON to an object $json = json_decode( $content ); $coord = $json->features->geometry->coordinates; // this will give you the coordinates of the user echo $coord ; $timeStamp = $json->features->properties->timeStamp; // timestamp of the last update echo $timestamp ; // If you want to retrieve the longitude & latitude separately $latitude=$coord; $longitude=$coord; echo "Your current coordinates Latitude :".$latitude." Longitude".$longitude ; ?>
g) How do I get the userID?
Under the Google Latitude Badge a small code similar to as
shown below is seen .
<iframe frameborder="0" height="300" src="http://www.google.co.in/latitude/apps/badge/api?user=XXXXXXXXXXXX&type=iframe&maptype=roadmap&hl=en-GB" width="180"> </iframe>So the XXXXXXXX is your userID replace that in your code and
you can have your code running .