(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
locmanager = [[CLLocationManager alloc] init];
[locmanager setDelegate:self];
[locmanager setDesiredAccuracy:kCLLocationAccuracyHundredMeters];
[locmanager setDistanceFilter:10];
[locmanager startUpdatingLocation];
[window makeKeyAndVisible];
return YES;
}
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
CLLocationCoordinate2D loc = [newLocation coordinate];
latitude = [NSString stringWithFormat: @"%f", loc.latitude];
longitude= [NSString stringWithFormat: @"%f", loc.longitude];
//Call to the web service for sending data
}
当手机启动时,是否可以自动启动此应用程序?我不希望用户启动此应用程序。启动GPS应用程序即服务
当应用程序在后台运行时,是否可以将数据发送到服务器。 – agupta 2010-11-03 22:57:22
不是真的 - 只有当您安排后台任务时。你有10分钟时间来完成后台任务。 – Moshe 2010-11-03 23:12:40
我在某处读到,当您调用startMonitoringSignificantLocationChanges时,位置服务将使用单元格定位监视位置更改,而不管您的应用程序是否正在运行,然后在发生位置更改时启动应用程序。 这是否有意义... – agupta 2010-11-03 19:30:56