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