Test for Hardware GPS

Discussion in 'iOS Programming' started by xArtx, Oct 8, 2013.

  1. xArtx macrumors 6502a

    Joined:
    Mar 30, 2012
    #1
    Hi Guys,
    I want to check the difference between iPads with cellular
    (and therefore with hardware GPS), or wifi only models.

    Is this possible without using the device requirement for "gps" to exclude them?
    I want to check at run time.
    Basically allowing the iPad to operate to view a map,
    but not allow an iPad with no GPS hardware to be used navigating terrain.
    Cheers, Art.
     
  2. Richdmoore, Oct 8, 2013
    Last edited: Oct 8, 2013

    Richdmoore macrumors 65816

    Richdmoore

    Joined:
    Jul 24, 2007
    Location:
    Troutdale, OR
    #2
    Many of us in aviation use mfi certified bluetooth GPS add-ons, so you will want to check for those as well, or allow a bypass/override of the check.

    http://bad-elf.com/products/be-gps-2200
    http://gps.dualav.com/explore-by-product/xgps150a/
    https://buy.garmin.com/en-US/US/oem/sensors-and-boards/glo-/prod109827.html

    I believe most aviation apps find out the position accuracy that is reported by the internal/eternal gps, then puts up a flag or other warning. If no gps hardware/add-on is present, it will always be fairly inaccurate.
     
  3. xArtx, Oct 9, 2013
    Last edited: Oct 9, 2013

    xArtx thread starter macrumors 6502a

    Joined:
    Mar 30, 2012
    #3
    I think the GPS add-ons that have approval should be invisible to us
    (I think they would integrate with Location Services so we wouldn't know the difference),
    but I could be wrong.

    For example, if a user connects a bluetooth keyboard to an iPhone,
    I don't think there's many circumstances where the programmer of the App
    has to know or care because iOS makes it so his App sees the same thing.

    Interesting though, that if an App has a device requirement for gps,
    you wouldn't even see it in the App Store when viewed on a wifi only iPad,
    even though the external device could allow that iPad to use it.



     
  4. moonman239 macrumors 68000

    Joined:
    Mar 27, 2009
    #4
    You could check the stated accuracy of the position. I'd say that any precision (there's a difference between accuracy and precision) < 20 ft indicates that the the iPad has a GPS chip and the chip is on and has received signals from GPS satellites.
     
  5. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    Please explain.
     
  6. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #6
    My high school chemistry teacher drilled this into our heads.

    Precision is the number of units you use to describe a value.

    Accuracy is the amount of error in a measured value.

    Say you have a scale that measures weights with a value that can vary by plus or minus 1/2 gram. It has an accuracy of 1 gram. (If the scale says 2.5 grams, the weight might be as light as 1 gram or as heavy as 2 grams.)

    Now, when you right the value from such a scale down, you might write 2.5001 grams. The number of decimal places in your answer is the precision of your answer, or how exactly you specified it.

    That would be 5 significant digits of precision. However, the scale can only measure to the gram, so your precision far exceeds your accuracy. Those extra decimal places are pointless.
     
  7. dantastic macrumors 6502

    dantastic

    Joined:
    Jan 21, 2011
    #7
    Having done a good bit of work in the area. 65m seems to be the best wi-fi accuracy. So if you have a reported accuracy of exactly 65m and it never gets any better, you're getting your position from a wifi base station. If it goes below you know you have a gps chip.

    You probably want to remember this as if you are inside a building you won't be getting a gps signal.
     
  8. xArtx, Oct 10, 2013
    Last edited: Oct 10, 2013

    xArtx thread starter macrumors 6502a

    Joined:
    Mar 30, 2012
    #8
    Outdoors, in a rural area, cloud cover, etc, Loc Service may never give good accuracy.

    I know that speed is one way to do it.
    wifi only always reports 0 for speed, you will always see speed if the GPS is actually used,
    but I thought there might be something more clear cut.

    I got a moon percentage illumination algo, it's 32.850961% illuminated,
    this figure changes every second, but the algo has 10 minutes error margin.
    How many digits should I display? This is a problem I have considered! :D
     
  9. dantastic macrumors 6502

    dantastic

    Joined:
    Jan 21, 2011
    #9
    For gps position, 6 decimal points is generally used.
    Just use a float and be done with it ;)
     
  10. waterskier2007 macrumors 68000

    waterskier2007

    Joined:
    Jun 19, 2007
    Location:
    White Lake, MI
    #10
    One of my teachers explained it as this

    If you throw three darts and they all three hit in the same area, but it's not the bullseye, that's precision

    If you throw those same three darts but and they are close to the bullseye but note as clumped together, thats accuracy

    [​IMG]
     
  11. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #11
    Thanks for the recaps on the difference!

    But the real reason I asked moonman239 to explain was that his first statement was:
    Then his second statement was:
    With his disclaimer of "there's a difference between accuracy and precision", I wanted him to elaborate on how you could discern precision by checking the accuracy.
     
  12. moonman239, Oct 10, 2013
    Last edited: Oct 10, 2013

    moonman239 macrumors 68000

    Joined:
    Mar 27, 2009
    #12
    An iDevice can tell an app how accurate the device thinks its location estimate is. It's really using statistics to figure out how precise its estimate of your location is.
     
  13. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #13
    Actually, it's telling you how ACCURATE the estimate is.


    Precision is not really relevant in this case, since iOS uses a fixed data structure (double PRECISION floating point values) to describe locations. It does not vary the precision with which it describes your location, it tells you how accurate that reading is.
     
  14. xArtx thread starter macrumors 6502a

    Joined:
    Mar 30, 2012
    #14
    The displayed numbers you see for Horizontal and Vertical Accuracy are derived
    from a variable called Dilution of Precision.
     
  15. xArtx thread starter macrumors 6502a

    Joined:
    Mar 30, 2012
    #15
    There could be some bug favourable to programmers.
    I uploaded my iPhone GPS App (the first update able to run on any iPad),
    but with the "gps" device requirement in plist to stop wifi only iPads running it.

    Before uploading the update to iTunes, I put the update on my wifi only iPad
    with Xcode by removing the "gps" requirement, and then putting it back afterward.

    Then when the update was approved, I was able to see it on my wifi only iPad,
    and do the update (to the same version).

    So I have a signed App on my iPad that was not supposed to be able to get there.
     

Share This Page