So a hypothetical with skeleton code. The goal is to get my wife's real-time updates from Latitude and track her while she is running. Note that I am doing this with my phone and the problem I am getting is I get the right location but it does not update. I call this every second as I move around. Any advice or pointers to what I am doing wrong and why this is not a good method to a friend's real-time GPS is greatly appreciated since I am spinning my wheels at this point. I am doing this in Android inside ECLIPSE and I have a EVO 4G.
SKELTON CODE: // My wife's Latitude address where she is sending real time locations String WIFES_URL = "https://www.google.com/latitude/apps/badge/api? userWIFES#####################&type=json"; // Get a URL and then open a connection URL kml = new URL(WIFES_URL ); URLConnection jsonConnection = kml.openConnection(); String json = convertStreamToString(jsonConnection.getInputStream()); // Use JSON get open a feed JSONObject jsono = new JSONObject(json); JSONArray features = (JSONArray)jsono.get("features"); JSONObject feature = features.getJSONObject(0); JSONObject geometry = (JSONObject)feature.get("geometry"); JSONArray coordinates = (JSONArray)geometry.get("coordinates"); JSONObject properties = (JSONObject)feature.get("properties"); // Get the location and time stamp. **NOTE these always are the same when i put my address in. long l1 = properties.getLong("timeStamp")*1000; String latitude = Double.toString(coordinates.getDouble(0)); String longitude = Double.toString(coordinates.getDouble(1)); int accuracy = properties.getInt("accuracyInMeters"); On Jan 17, 11:26 am, Kumar Bibek <coomar....@gmail.com> wrote: > The Latitude app takes your co-ordinates from your phone, uploads it to the > Google servers, and then, it gets pushed everywhere else. > > I guess, this is what you should also be doing. You can use the Latitude > APIs to update your own location. But looking at the API reference, I don't > think it supports querying a a specific persons location. So, for your case, > you will not be able to use this API. > > Instead, your own server might handle this information between two devices. > > Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com > > > > On Mon, Jan 17, 2011 at 11:47 PM, Chris Grant <cwg...@gmail.com> wrote: > > Kevin: > > > I think you understand more what I am after. I am making an > > application that is like My Tracks, but does much more. I want to be > > able to do tracks besides my own. > > > So the thinking is, my wife turns on her GPS and has a gmail account. > > I somehow ping her GPS location feed via JSON or REST or GeoJSON(?), > > get the points as she moves around, and then my app does all the > > things it will do with her position changes. > > > Just curious, I was watching myself update last night via Latitude on > > Google Maps as I drove out for a beer, and it was real time and it was > > extremely accurate. I presume Google Maps Latitude it is pinging the > > Latitude service to get these updates in real time?? Or is Latitude > > somehow using my LocationService and getting real time feeds from my > > device? > > > Thanks, > > > Chris > > > On Jan 16, 10:56 pm, Kevin Duffey <andjar...@gmail.com> wrote: > > > I was going to suggest My Tracks as well. But I think what the OP wants > > is > > > the ability for his wife's phone to update his phone on her progress. I > > > would guess it's possible, but you'd have two components to the app. The > > app > > > that runs on her phone that updates some service of her progress.. maybe > > > using GPS location every 5 seconds or something (not sure the precision > > of > > > GPS info.. anyone know how often it updates?). The second piece would > > either > > > be a web service or a SMS listener app on the 2nd phone that would get > > > updates. If it was solely to be to track one phone from another, probably > > > have the phone to be tracked send updates out via SMS to the 2nd phone, > > > which..I think in 2.1. maybe 2.2, added the ability to have SMS listeners > > or > > > something like that.. > > > > Latitude I think has 15 minute updates. There is the option to turn on > > > real-time updates for a set amount of time, but this has never worked for > > > me. I've done this with my wife's phone, and I still seem to only get > > > updates every 10 or 15 minutes. I think for road trips, and finding a > > phone > > > or seeing where your wife is.. it's fine. But using it for real-time > > updates > > > is not. You're going to be better off writing an app that continually > > grabs > > > GPS info and sends that data somewhere. > > > > Incidentally.. this is an excellent way to keep tabs on someone. ;) > > > > On Sun, Jan 16, 2011 at 7:04 PM, Zsolt Vasvari <zvasv...@gmail.com> > > wrote: > > > > Try the free open-source Google app called My Tracks. I've used it > > > > before and it's good. > > > > > On Jan 17, 9:37 am, Chris Grant <cwg...@gmail.com> wrote: > > > > > Hmmm... not even sure what a "runner app" is. Do I buy this? How is > > > > > it integrated in to my app so that i can get a friends location? It > > > > > is ashame that Latitude for all its hype, is this hard to use and so > > > > > unreliable. Anyone else have ideas on the easiest and most reliable > > > > > way to get a friends location? > > > > > > Thanks, > > > > > > Chris > > > > > > On Jan 16, 4:49 pm, Marcin Orlowski <webnet.andr...@gmail.com> > > wrote: > > > > > > > On 16 January 2011 21:12, Chris Grant <cwg...@gmail.com> wrote: > > > > > > > > Does anyone out there have a snippet of code that shows how to do > > > > this > > > > > > > in an Android app? Or can you point me to a real example? > > > > > > > Not the answer you expect, but IMHO dedicated "runner" apps would > > > > > > serve the purpose better and there're couple of such on Market. > > > > > > Latitude is not reliable (if you ask me) and you won't get as > > frequent > > > > > > reports as you may need.- Hide quoted text - > > > > > > - Show quoted text - > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "Android Developers" group. > > > > To post to this group, send email to > > android-developers@googlegroups.com > > > > To unsubscribe from this group, send email to > > > > android-developers+unsubscr...@googlegroups.com<android-developers%2Bunsubscr...@googlegroups.com> > > <android-developers%2Bunsubscr...@googlegroups.com> > > > > For more options, visit this group at > > > >http://groups.google.com/group/android-developers?hl=en-Hide quoted > > text - > > > > - Show quoted text - > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com<android-developers%2Bunsubscr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en