1

Is it possible to actually determine with any degree of certainty whether an iPAD actually has a GPS signal. I can think of three cases

  • Wifi-Only IPAD
  • Wifi-Only IPAD with External GPS (such as the DualXGPS)
  • Cellular IPAD with Internal GPS

Apple documentation mentions:

Some location services require the presence of specific hardware on the given device. For example, heading information is available only for devices that contain a hardware compass. This class defines several methods that you can use to determine which services are currently available.

Are there specific calls that work specifically with a GPS only such as heading or tracking? I'm assuming perhaps only GPS devices have a heading call because the documentation says:

In iOS, a device with the appropriate hardware may also report heading information. When the value in the headingAvailable property is YES, you can use a location manager object to retrieve heading information.

Some previous posts suggested trying to get a lock on a very accurate GPS update

but i was hoping for something a little more concrete these methods "feel" wishy-washy - because just because an inaccurate GPS signal would likely look like there is no GPS when the device actually has the capability. Also I would think a wifi device which can "mimic-gps" might also some how pass one of these conditions.

Thanks for any help!

Community
  • 1
  • 1
Jeef
  • 26,861
  • 21
  • 78
  • 156

2 Answers2

2

The simplest answer is that you should try to use the GPS at the accuracy you need and see if you get it. And deal with the fact that you might not get this accuracy because the user is in a building, or an urban canyon, or doesn't have GPS hardware, or has turned off location services (although this can be detected).

If you get better than 100m accuracy or if the CLLocation has altitude you almost certainly have GPS hardware (but you have to wait quite some time to get a signal lock on at least 4 satellites to get altitude). If you have a cellular radio connection (see Reachability) then you have GPS hardware (except iPhone1). If you have digital compass capability then you have GPS hardware (except iPhone 3G).

Internal GPS hardware is available on all iPhone and iPad that have cellular radios (except iPhone 1, see wiki chart). If you study that chart it appears that all devices (so far) that have GPS hardware also have digital compass (magnetometer) except iPhone 3G.

Using course (as suggested here) from the CLLocation only works if the device is moving fast enough and the GPS has satellite lock. A better option would be to detect if you have a heading from the compass (magnetometer).

You can use the hardware string to determine device capabilities by hardcoding a table of what hardware has what capabilities (described here). This has to be kept updated (which means an app update) when new devices are introduced. Erica Sadun has categories for UIDevice called Capabilities and Hardware on github that attempts this, but may not be usable in the app store.

None of this will help with external plug-in GPS or external bluetooth GPS devices.

Community
  • 1
  • 1
progrmr
  • 75,956
  • 16
  • 112
  • 147
1
if (location.getHoricontalAccuracy()< 40) {
  // for sure GPS
} else {
 // no GPS or unusable bad GPS
}

you can also use speed and course, if they are valid, then they are from GPS, because It is the only sensor that can measure speed and course. (magentometer shows the current heading, which works without GPS)

AlexWien
  • 28,470
  • 6
  • 53
  • 83
  • Unfortunately this is what i was afraid of. There is no actual way to know. In any case i'm logging the accuracy so that will have to suffice for now. – Jeef Feb 20 '14 at 16:35