Hello,
I´m playing a bit with the iPhone SDK and I want to show the current speed in my Application. There are so many Apps that can do that really precise, espacially for low Speeds like running or biking. The Best I´ve seen is RunKeeper.
But in my Application the Speed is absolutely inaccurate. In Low Speeds is always null and only at higher speeds it shows some values but they are rarely updated and noot really usefull.
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation {
if (newLocation.timestamp > oldLocation.timestamp &&
newLocation.verticalAccuracy > 0.0f && // GPS is active
newLocation.horizontalAccuracy < 500.0f && // GPS is active
//newLocation.horizontalAccuracy < kCLLocationAccuracyHundredMeters && // good quality GPS signal
//newLocation.speed > 1.0f && // enough movment for accurate speed and course measurement
oldLocation != nil) // oldLocation is nil on the first reading
{
double speed = (newLocation.speed * 3.6);
[self updateDisplayWithSpeed:speed];
//double direction = newLocation.course;
}
}
Does anyone has working Code for that? Or can tell me what´s wrong with mine?
Thank you so much
twickl