开发者

IPHONE: Can I use GPS without internet to get current LATITUDE AND LONGITUDE

I am creating an application in that I need only current Latitude and longitude of the device using the GPS i.e. using iPhone4.

I just want to know Do I need the Wifi or internet connectivity or not ??

I do have operator card as well as my d开发者_高级运维evice will be jailbroken and also having 3g facility means iphone 3gs or iPhone 4.

So can I get Lat and Long for the same ?

thanks in advance.


Data connectivity is only used by A-GPS (Assisted GPS) to find and use satellites faster and better in conditions where there are poor radio signals. Standalone GPS, per se, does not require any data connectivity to perform its function. However, if you start your application or the iPhone in an area where signals are low or poor, and you don't have data connectivity, your device (and the GPS on-board) will not likely be able to connect to satellites to get location information.


Yes you can use GPS for it as it doesn't need internet connection, but it

(1) takes a long time to get position and (2) doesn't work properly inside buildings or streets

By this way you can do it:

-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations{

    CLLocation * currentLocation = [locations lastObject];

    NSLog(@"%f",currentLocation.coordinate.longitude);
    NSLog(@"%f",currentLocation.coordinate.latitude);

    if (newLocation.horizontalAccuracy < 0) {
        return;
    }
    NSTimeInterval interval = [newLocation.timestamp timeIntervalSinceNow];
    if (abs(interval)>20) {
        return;
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜