How can I calculate real time speed on device? I've googled a lot but all I got is to calculate distance and speed after completion of journey. Can I calculate speed at runtime?
Suggestions will be much appreciated.
Thanks in advance.
here CLLocationManager
class provide different field of location like, Latitude, Longitude,accuracy and speed.
i use CoreLocationController
so for location update i call this bellow method
you can get current speed in - (void)locationUpdate:(CLLocation *)location method like bellow
- (void)locationUpdate:(CLLocation *)location
{
NSString *currentspeed = [NSString stringWithFormat:@"SPEED: %f", [location speed]];
}
or otherwise bellow is delegate method
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
NSLog(@"in update to location");
NSString *currentspeed = [NSString stringWithFormat:@"SPEED: %f", [newLocation speed]];
}
also you can get example from this link... http://www.vellios.com/2010/08/16/core-location-gps-tutorial/
i hope this help you... :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With