0

Im trying to specifically determine if the device the app is on has GPS chip or uses aGPS or nothing. If it is an iPhone or a Cellular iPad, i want it to run specific code.

I was hoping to find something like detecting if a camera is available...

if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])

thanks in advance.

OscarTheGrouch
  • 2,374
  • 4
  • 28
  • 39
  • 1
    No iPhones have a regular GPS chip in it. They are all aGPS (except the iPhone 2g which doesn't have a GPS chip). – Skyler Saleh May 10 '11 at 04:30

1 Answers1

0

I don't think aGPS means what you think it means.

Normal GPS receives signals from satellites with an antenna. It takes time to lock on to the signal, as it has to have heard from at least three satellites before it can work out a position. Hence, the lock can sometimes take a couple of minutes.

aGPS, like regular GPS, uses an antenna to receive signals from satellites. However, it's got an extra feature to speed up finding them: it gets sent data over the internet that tell it where the satellites are likely to be. Assuming the user hasn't moved too far from the last place they got GPS, then this information means the device has a general idea where to look for the incoming signal, so it can find the satellites more quickly. Once it has found the satellites, it functions just the same as plain GPS.

To answer your question, no iOS device has GPS but not aGPS. The original iPhone had neither, and the 3G had both.

I think what you're actually talking about is cell tower triangulation: that's another method of working out location that is less accurate than any flavour of GPS, and doesn't have the ability to receive signals from the satellites.

You can ask Core Location for the level of accuracy of an individual location: look at the horizontalAccuracy property on CLLocation. If it's kCLLocationAccuracyHundredMeters or above, then the device probably isn't using GPS or aGPS. However, that doesn't mean the device isn't capable of it: it may just not have achieved a lock yet.

Amy Worrall
  • 16,250
  • 3
  • 42
  • 65