PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, September 26, 2022

[FIXED] How can I evaluate the GPS signal strength? (iPhone)

 September 26, 2022     cllocation, gps, ios, iphone     No comments   

Issue

I need a way of categorising the strength of the GPS signal. So far I have come across the horizontalAccuracy property of CLLocation (Class Reference).

To be more specific I need to create something like the following; the issue I'm having is filling in the if statements.

if (someLocation.horizontalAccuracy ...)
{
    // No Signal
}
else if (someLocation.horizontalAccuracy ...)
{
    // Poor Signal
}
else if (someLocation.horizontalAccuracy ...)
{
    // Average Signal
}
else if (someLocation.horizontalAccuracy ...)
{
    // Good Signal
}
else
{
    // Excellent Signal
}

Please can someone assist me in this?


Solution

I've used figures like this in the past:

if (someLocation.horizontalAccuracy < 0)
{
    // No Signal
}
else if (someLocation.horizontalAccuracy > 163)
{
    // Poor Signal
}
else if (someLocation.horizontalAccuracy > 48)
{
    // Average Signal
}
else
{
    // Full Signal
}

but to be honest, it didn't really work very well for users. It would show as low accuracy, but when they looked at the maps app, it would have located them almost perfectly (albeit with a circle around them).

Rather than trying to define a level of accuracy, and if your app is map based, could you do what Maps does and show the horizontal accuracy as an circular overlay? Then the user can decide for themselves if it's accurate enough.



Answered By - Ashley Mills
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing