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 08-30-2010, 04:12 AM   #1 (permalink)
Registered Member
 
Join Date: Apr 2010
Location: Milano
Posts: 99
zero_ is on a distinguished road
Default cllocation and tracking

i've a gps tracker that now works great, except when iphone lost gps connection.
When the connection is lost the track make one or more point to a random location (as you can see in this image:



In which way i can discard this bad values?

I've think to do in this way:
before save my data i can do a sum of my integer values of current latitude and longitude and compare with integer values of my old latutude and longitude; if the difference is > somevalue i discard my data.

It will be a good thing?
There's some other nice tricks to do this?

Thank's
zero_ is offline   Reply With Quote
Old 08-30-2010, 12:00 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

I think your approach will be good.
smithdale87 is offline   Reply With Quote
Old 08-31-2010, 03:46 AM   #3 (permalink)
Registered Member
 
Join Date: Apr 2010
Location: Milano
Posts: 99
zero_ is on a distinguished road
Default

maybe i've found my fault:

in
Code:
locationManager:didFailWithError:
when i receive a kCLErrorNetwork or any other error except kCLErrorDenied i perform a stopupdatinglocation and a startupdatinglocation.

Now i've comment that two line and the app works good also when there's no gps signal, i make some other test tomorrow and post here the result.
zero_ is offline   Reply With Quote
Old 09-14-2010, 01:40 AM   #4 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 1
sunmom is on a distinguished road
Default PLEASE GIVE ME ANY SAMPLE CODE TO TRACK THE LOCATION

I M NEWER TO THIS
PLEASE HELP ME
sunmom is offline   Reply With Quote
Old 01-10-2011, 08:38 AM   #5 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 2
JamesJesst is on a distinguished road
Default

V interesting post. Thanks for this and your update, nice lateral solution to a problem I had been experiencing too. I'm not building a 'GPS-tracker' app like yours, but I do want to store CLLocation objects in an array so that I can use them later (not for map annotations). At the moment I just stick them in a NSMutableArray and php POST them to MySQL on a remote server.

However, my experience has not been a great one. Walking around town with the app activated creates a massive number of objects into that array that (I fear) may be crashing my app (there are no leaks, or at least none when on simulator). I'm wondering if you came up with a more elegant solution to this that you'd be prepared to share?

Many thanks
JamesJesst is offline   Reply With Quote
Old 01-10-2011, 08:43 AM   #6 (permalink)
Registered Member
 
Join Date: Apr 2010
Location: Milano
Posts: 99
zero_ is on a distinguished road
Default

Quote:
Originally Posted by JamesJesst View Post
V interesting post. Thanks for this and your update, nice lateral solution to a problem I had been experiencing too. I'm not building a 'GPS-tracker' app like yours, but I do want to store CLLocation objects in an array so that I can use them later (not for map annotations). At the moment I just stick them in a NSMutableArray and php POST them to MySQL on a remote server.

However, my experience has not been a great one. Walking around town with the app activated creates a massive number of objects into that array that (I fear) may be crashing my app (there are no leaks, or at least none when on simulator). I'm wondering if you came up with a more elegant solution to this that you'd be prepared to share?

Many thanks
Hi James,

for some data i'm also storing all the values in a nsmutablearray. No leak problem also with 3hours of data collectios.
Maybe you can set a distance filter and collect datas in you array only when distance il > SOMEVALUES.
zero_ is offline   Reply With Quote
Old 01-10-2011, 09:48 AM   #7 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 2
JamesJesst is on a distinguished road
Default

Quote:
Originally Posted by zero_ View Post
Hi James,

for some data i'm also storing all the values in a nsmutablearray. No leak problem also with 3hours of data collectios.
Maybe you can set a distance filter and collect datas in you array only when distance il > SOMEVALUES.
Hey - thanks for your quick response. Yeah, I am moderating the number of objects I'm storing; meantime you are managing to store 3 hours worth of CLLocation objects into that array without melting your app? OK, then I suspect my problem lies elsewhere - just having real difficulty working out where. The instruments say there are no leaks, and the whole thing works fine if it runs for just a couple of minutes or so.

Of course it may be that there is a POST limit to MySQL which, of course, will be easily solved by locally persisting using Core Data. Anyway, back to the drawing board, thanks anyway!
JamesJesst is offline   Reply With Quote
Old 08-22-2011, 12:08 AM   #8 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 1
sarunw is on a distinguished road
Default

Can I ask how do you keep location data (Core data or using archive) ?
sarunw is offline   Reply With Quote
Old 08-22-2011, 12:54 AM   #9 (permalink)
Registered Member
 
Join Date: Apr 2010
Location: Milano
Posts: 99
zero_ is on a distinguished road
Default

hi sarunw,

in this specific app i use .csv file, i'm now working for a migration to .plist (but application works great also with .csv files)
zero_ is offline   Reply With Quote
Reply

Bookmarks

Tags
cllocation, cllocationmanager, map, track, tracking

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: 354
6 members and 348 guests
dre, freewind, hain, HemiMG, lendo, Newbie123
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,894
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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