How can I draw heading line from my current location to a specific destination ?

Hi Rob,

sorry to bother you but i really need your help and i need to make this app accurate as much as possible… now i am able to get the right direction after i make the arrow direct to right instead of up at start of the app … Not sure why ?

1_ which one is more accurate GPS or Wi-FI…? should i enable both ?

2_ my logic is like that  :

  a- find my location using location handler (Runtime:addEventListener( “location”, locationHandler )

  b- if successful then find angle between my location and the destination , then start heading with update compass function and animalDial to rotate the arrow

  c- also I stop the location handler if location is gathered…

is this right logic ?  do you have any advices ?

thanks
Abdulaziz

  1. GPS is way more accurate than WiFi.

  2. That logic seems sound!

Rob

Thanks Rob for help and advice., it is always appreciated…   I notice some apps similar to the these once using gyroscope or accelerometer  … is this something i need to consider for such  app to improve accuracy or this is not related to the main goal.

thanks

Abdulaziz

The GPS will always have some inaccuracy.  I think the military can get more accurate measurements because they use twice as many signals as the civilian system.  This is a quote from GPS.gov:

The actual accuracy users attain depends on factors outside the government’s control, including atmospheric effects, sky blockage, and receiver quality. Real-world data from the FAA show that their high-quality GPS SPS receivers provide better than 3.5 meter horizontal accuracy.

So atmospheric conditions, the ability to see multiple satellites and the quality of the receiver affect your overall accuracy.  Even the FAA who’s planes have very high quality GPS’s and don’t have to deal with buildings blocking signals only have a 3.5 meter accuracy (a little over 11 feet).  This means in best case you can be sitting still and the GPS will move you across the room.

In other words, you can’t improve accuracy, you are at the mercy of other factors.

The accelerometer determines if the phone is moving forwards or backwards, tilt and such.  The Gyroscope is an enhancement to the accelerometer that provides information about how the phone is being rotated.  Neither really have any impact on the GPS.

WiFi is useful because when you’re indoors you frequently can’t get to the GPS signals.  There is a huge database of WiFi hot spots that Google maintains.  Google can’t know the exact location of your WiFi router.  They know your address and IP address so they can get you in the neighborhood.   When you first turn location services on (and assuming you have cellular service), the device will try to triangulate its position based on cell phone towers.  The more towers it sees, the more accurate it can place you. If you’ve ever watched the map app, it frequently starts with a large circle and then the circle gets smaller as accuracy improves.  You might start at 5000 meters of accuracy and it will improve as it gets more information.  WiFi may get you into the dozens of feet of accuracy but it will get it quickly.  Finally when you get GPS signals, you will have the most accurate information.

I hope this helps you understand GPS accuracy.

Rob

Great   Thanks Rob for the time spent to write all this explanation … I apprecaite it . it is really useful. 

Abdulaizz