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

View Single Post
Old 09-22-2008, 04:12 PM   #9 (permalink)
varchar
Registered Member
 
Join Date: Aug 2008
Posts: 100
varchar is on a distinguished road
Default

I am having such a weird problem...

Apparently, the GPS information received from my code (which is almost exact as Apple's SDK examples) is not as accurate as when using the Maps app on the iPhone.

Interesting enough, if I go into maps app, locate myself, and then go into my app, I get accurate GPS coordinates.

BUT many times, if just going into my app and getting coordinates, they are not accurate at all.

Anyone have this experience too? IS there a way to force the GPS to get more accurate coordinates (yes I know of the distancefilter and desiredAccuracy, but still no dice... )

This is bugging me out.....

see code below... quite simple....



Code:
// Called when the location is updated
- (void)locationManagerCLLocationManager *)manager
didUpdateToLocationCLLocation *)newLocation
fromLocationCLLocation *)oldLocation
{


NSMutableString *lastTimeUpdated = [[[NSMutableString alloc] init] autorelease];
NSMutableString *currentLatitude = [[[NSMutableString alloc] init] autorelease];

NSMutableString *currentLongitude = [[[NSMutableString alloc] init] autorelease];

// Timestamp
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
[dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
[lastTimeUpdated appendFormat:@"%@\n\n", [dateFormatter stringFromDate:newLocation.timestamp]];

// Horizontal coordinates
if (signbit(newLocation.horizontalAccuracy))
{
// Negative accuracy means an invalid or unavailable measurement
[currentLatitude appendString:LocStr(@"LatLongUnavailable")];
}
else
{
// CoreLocation returns positive for North & East, negative for South & West

currentLatitude = [NSString stringWithFormat:@"%lf",newLocation.coordinate.lat itude];

currentLongitude = [NSString stringWithFormat:@"%lf",newLocation.coordinate.longitude];


}


lblMyCurrentLatitude.Text = currentLatitude;
lblMyCurrentLongitude.Text = currentLongitude;
}
Thanks for any help you can provide....
varchar is offline   Reply With Quote
 

» Advertisements
» Online Users: 386
22 members and 364 guests
Absentia, alexP, blackcat_tq, Bobarino, Duncan C, eski, Farfalo, flamingliquid, Garros1990, hacker073, ilmman, jbro, MysticLine, n00b, Newbie123, nmi300, NSString, Objective Zero, PandaUser, pinky, Sami Gh, SuperDietGenius
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,560
Threads: 94,079
Posts: 402,744
Top Poster: BrianSlick (7,990)
Welcome to our newest member, mongmo
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:50 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.