Getting Location from Phone (via GCM) possible?

Hi Developers,

I'm just wondering if there is (meanwhile) an API to get a location (Lat/Lon and ideally alltitude) from the connected phone (iOS or Android).
There were lots of discussions about pros and cons for having this and you can question if it's really required for outdoor scenarios. But for indoor it would be very helpful.

There was a request a while ago regarding this. Did Garmin comment on this request?

I would like to get/use the phone location in a web call for my UV-Index app (as I need the GCM connection anyway for the internet connection). Many of my user would like to check the UV-Index before they go out in the sun. Makes perfect sense.

Other option would be caching GPS fix from the watch, but for various other reasons I do not really like this option.

Thanks for any help.










  • You could write a companion app for the phone and get data that way, but that's it
    .
    As far as caching a location, it's pretty easy to do, and is what's commonly done for things like sunrise/sunset, weather data, etc.
    Check Activity.Info.currentLocation, as that will have the last location from an activity, and will be valid for a period of time after you've finished that activiy (maybe a few hours).

    if it's valid, use it, and save it to the ObectStore. If it's not valid, use the location saved in the ObectStore. After the first time you app runs, you'll have one of the two

    For something like a widget, you can also throw starting GPS into the mix.