aspose file tools*
The moose likes Android and the fly likes Find Friend Location Java Example-latitude. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Find Friend Location Java Example-latitude." Watch "Find Friend Location Java Example-latitude." New topic
Author

Find Friend Location Java Example-latitude.

sampath premarathna
Greenhorn

Joined: Oct 05, 2010
Posts: 13
Hello ,

Does anyone have any simple java source examples on how to find a "GPS" friend, determine if they are sharing their location via Google Latitude API and then get their location.
(this post may not suit for here but i post this here because i couldn't find any place to ask this and sorry for that).

thanks.
sampath premarathna.
sampath premarathna
Greenhorn

Joined: Oct 05, 2010
Posts: 13
Finally got a solution. first of all you have to get the user id for the user that you going to get location from https://www.google.com/latitude/apps -> Enable and show best available/Enable and show city-level only . then you can get JSON or ATOM format user details from latitude and then you can get the location and ... using that.
call--
LatitudeJSONParser.getPosition("http://www.google.com/latitude/apps/badge/api?user=" + userid+ "&type=json");

you can find LatitudeJSONParser.java and other required java files from here.
http://code.google.com/p/whereisschtief/source/browse/trunk/?r=17#trunk/WhereIsSchtief/src/org/schtief/whereisschtief
Chris Grant
Greenhorn

Joined: Jan 16, 2011
Posts: 1
Sampath:

Thanks for doing this. I have been looking for this for a while and someone finally posted something on this. I followed your example. I have a gmail acct and an Android phone. I shared myself public and added this line of code in my app (note that MYUSERCODE has my real # from the latitide site):


Location l = LatitudeJSONParser.getPosition("https://www.google.com/latitude/apps/badge/api?user=MYUSERCODE&type=json");

I am getting back a location that seems to be in my neighborhood, but it does not update. The time stamp, lat and long stay the same and i drove around for a good mile. Any thoughts? I am updating the printout every second.

Chris
sampath premarathna
Greenhorn

Joined: Oct 05, 2010
Posts: 13
Sorry i cant give you a clear answer.But i think it may because of your internet connection.Google may get your location from that location and it is never change.something like that.
Mostafa Mamdouh
Greenhorn

Joined: May 20, 2012
Posts: 2
hey all,i need your help please, i downloaded the whole package ,when i try to use your command line,it gives me error it the object must start with "{",then i read in the class that object must start and end with "{" ,it gives me wrong exception and prints out saved data such as {"content":"This is a collection of test patterns and examples for org.json."}
{"list of lists": [,i really need your help.
Best Regards
Mostafa Mamdouh
Greenhorn

Joined: May 20, 2012
Posts: 2
thanks i fixed it ,dummy mistakes, for chris i think i got an answer for you,see it updates only based check in,but location history which google latitude record it every second isn't available for public
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Find Friend Location Java Example-latitude.