Discussion Forums  >  Maps, Device Location, Tracking

Replies: 3    Views: 102

SAApps
Aspiring developer
Profile
Posts: 4
Reg: Aug 27, 2012
Durban
1,690
09/10/12 10:07 AM (13 years ago)

Measure it

is it possible to use the gps on the phone to measure a distance with a start and end button?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
09/10/12 10:45 AM (13 years ago)
Yep! You could have a 'Start' button that captures the starting lat/long, and a 'End' button that captures the ending lat/long, and use an equation to calculate the straight line distance. Google can probably spit out that equation pretty quickly. If, however, you wanted to capture the distance along a route...that would be a bit more difficult, and probably requires capturing a set of points, calculating the distance between each, and then adding them up. The accuracy would depend on the number of points you capture. I'd Google for the basic algorithms needed for this. But it's very easy to get your device to report its current location and have that stored in a database or something. Here's a forum discussion to get you going: http://www.buzztouch.com/forum/thread.php?tid=6A0E0F30B5413FF704B3A04 Hope this helps! Mark
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
09/10/12 10:46 AM (13 years ago)
Distance between two points: http://www.movable-type.co.uk/scripts/latlong.html Mark
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
09/10/12 11:49 AM (13 years ago)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.