Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 04-15-2011, 08:27 AM   #1 (permalink)
Registered Member
 
Join Date: Apr 2011
Posts: 3
Super Terry Airlines is on a distinguished road
Default Using iPhone GPS to calculate total distance travelled by the user

Hi folks,

I am currently working on creating an iPhone app which, among many things, tracks the total distance a user has travelled during any sort of sports game. I am using HTML, CSS and Javascript to code the app. I want to use the iPhone's inbuilt GPS System to compute the total distance travelled.

I was thinking that I could firstly use the GPS to get the user's start position at 0 seconds (t = 0). Calculate the user's new psoition at a time interval (i.e. every 5 seconds) adding the distance travelled in that time to the original distance. I would repeat this loop until the user was finished their session.

However I am not the greatest programmer in the world. Therfore, any advice you could give me on coding this, presumably, in Javacript would be fantastic.
Super Terry Airlines is offline   Reply With Quote
Old 04-15-2011, 08:29 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

in javascript?

However yes, the right approach is to have an array of points from gps and calculate the total distance.

start reading...
CLLocationManager

http://stackoverflow.com/questions/3...ated-correctly
__________________
dany_dev is offline   Reply With Quote
Old 04-15-2011, 08:41 AM   #3 (permalink)
Registered Member
 
Join Date: Apr 2011
Posts: 3
Super Terry Airlines is on a distinguished road
Default

Quote:
Originally Posted by dany_dev View Post
in javascript?

However yes, the right approach is to have an array of points from gps and calculate the total distance.

start reading...
CLLocationManager

iphone - distanceFromLocation - Total Distance not being calculated correctly - Stack Overflow
I'm coding my app in HTML, Javascript and CSS using Phone Gap in Xcode to change my app from a web app to a native application. I'm not the greatest programmer in the world and using Objective C is slightly beyond me.

Can I code this in Javascript?
Super Terry Airlines is offline   Reply With Quote
Old 04-15-2011, 09:07 AM   #4 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

check PhoneGap documentation
PhoneGap API Documentation
__________________
dany_dev is offline   Reply With Quote
Reply

Bookmarks

Tags
app, distance, gps, iphone, javascript

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 366
14 members and 352 guests
dansparrow, dre, ilmman, LezB44, lorrettaui53, Nobbsy, Objective Zero, oztemel, pbart, samdanielblr, shagor012, sledzeppelin, thephotographer, Trickphotostudios
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,119
Posts: 402,896
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:46 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0