Reputation: 915
I want to access my current location in my application in android. Initially I did that with WIFI and CELL TOWER in indoor. I used GPS to access locations at outdoor. The location accessed via GPS is accurate but via WIFI is far away from the actual spot. Can anyone help me regarding this issue.
Upvotes: 0
Views: 2591
Reputation: 605
Location is a crapshoot.
Generally, GPS is accurate enough to get you to right address - and even that can't be counted on. Wifi to the right neighborhood, and cell tower the right zip code (or neighboring one). If you need to locate people within specific buildings, use one of the "indoor positioning systems". There are a couple available for android but you need to prepare the buildings.
There is a lot of nonsense about triangulation posted in this thread.
Old time surveyors and radio direction finders used triangulation. GPS, cell tower, and wifi do not use triangulation; they use Trilateration (or worse mere proximity). Triangulation is the determination of position by the measurement of angles (minimum of not three but two angle measurements and one baseline distance make a triangle). Trilateration or multilateration is the determination of position by measurement of distance which in this case is derived from time of travel (GPS, some cell network based location systems) or received signal strength (cell tower, wifi). And often you don't have at least three towers or routers to properly trilaterate off of. You can get some position data from two towers but it has more ambiguity as it doesn't know which side of the line between the two towers you are on. These two alternative locations can potentially be almost as far apart as the cell towers themselves. And if you only have one, then you can only narrow the position down to the working area around the tower (or one or two sectors of that radius based on which of the three antenna arrays sees the cell phone).
Cell towers may be as close as 1/4 mile in urban areas, 1-2 miles in suburban, and as much as 22 miles apart (GSM timing limit) in rural areas (particularly when located on mountain tops). So the nearest cell tower might be dead on accurate if you happen to be standing at the base of the tower but in practice it is likely to be off by 1/8mile to 22miles. Yet a woman was falsely convicted of murder and incarcerated because this method ["pinpointed"][1] her location - give or take 22 miles.
If we have several cell towers in range we could trilaterate the position but the accuracy will be limited by the crudeness of the signal strength based interpolation and the very long baseline between towers. Is the signal weaker because of more distance or is it weaker because it had to go through walls, trees, and shrubs and had to bend around buildings, trees, and shrubs? Was the signal reflected off other objects? Or because the transmit signal strength was lower to start with?
For WiFi, the routers are frequently located at each house and business. So they may be 50 feet from one another. And there is a very good chance that you are located very close to the wifi you are using or nearest. WiFi location may not work at all in many areas because the buildings are so spread out.
And WiFi and cell tower based location depend on having a database of tower and wifi router positions which is often incomplete, approximate, and sometimes wildly inaccurate (consider what happens when you buy a wifi router at goodwill and leave the SSID the same or move a router). Google gets this data by driving streetview vans around collecting data and by grabbing data from user's phone cellular radios and GPS. [Skyhook wifi location][2] accuracy estimates: 1 Wifi: 700 ft, 3-4Wifi: 150ft, dense urban, more wifi: 50ft. Google
GPS has much larger distances between satellites and users compared to wifi and cell based systems but is a much more sophisticated system engineered from the ground up to be a locator system and using sophisticated timing measurements. It works almost anywhere on earth but can have problems with heavy tree canopy, dense tall buildings (skyscrapers), or being inside buildings. And with inferior devices that don't have a GPS chip. Or with the GPS chip being turned off because it consumes significant amounts of battery power. Most devices today have wifi even if they don't have GPS or Cellular.
In approximate order from worst to best (may vary depending on location):
Accuracy of each technique can vary a lot and rather than being accurate to a stated distance, it is a probabilistic distribution.
For one dedicated outdoor (trail) GPS receiver I own combined with an external antenna, someone [measured][3] that 10% of the time, the accuracy was about 1m, 50% of the time the accuracy was about 2.9m, 95% of the time the accuracy was within 6.9m, and 99% of the time it was within 10.1m. And 1% of the time, it is just embarassing. So most of the time, it can locate you to about the size of a suburban lot. And on average it is about 10ft. A cell phone might use a newer chip but it also has a much lousier antenna.
Also, within a building you can use NFC tags, QR codes, 2D barcodes, and bluetooth beacons to designate specific locations such as rooms, workstations, businesses, departments, check out lines, etc.
[1]: https://www.techdirt.com/articles/20140908/04435128452/turns-out-cell-phone-location-data-is-not-even-close-to-accurate-everyone-falls-it.shtml Turns out cell phone location data is not even close to accurate
[2]: Howardforums thread 1383415
[3]: http://www.leb.esalq.usp.br/disciplinas/Molin/leb447/Arquivos/GNSS/ArtigoAcuraciaGPSsemAutor.pdf GPS HORIZONTAL POSITION ACCURACY
Upvotes: 2
Reputation: 29436
GPS uses satellite triangulation method.
WIFI/CELL just uses tower location, and assumes you are somewhere around in its area/range.
Upvotes: 0
Reputation: 82543
The GPS system determines your position by connecting to and timing the responses from 4 different satellites. Due to this, it requires a clear view of the sky, and doesn't work indoors and underground. It also allows it to be very accurate.
On the other hand, WiFi positioning uses a table compiled by Google and other companies and organizations that has anonymously collected data about wifi hotspots and GPS positions of devices connected to those. This is much less accurate than GPS.
Cell network positioning uses the Triangulation technique, which uses one or more cell phone towers to determine the approximate location of the device. This method is explained very well here.
Upvotes: 5
Reputation: 3011
The Wi-Fi and cell tower combine to give you what is called COARSE accuracy in Android. By default this is stated as an inaccurate result and is only approximation of your location. This method gives a faster result and uses less power, and therefore gives an approximate result.
The GPS result is called FINE accuracy in Android, naturally because its result is finer and more correct when you use the maps. This comes with the fall back of taking a longer time to calculate, as well as using more battery power.
I would suggest you use the getBestProvider method to determine which provider is the best at any given time and it will give you the most possible accurate location. Unfortunately if it uses any of the coarse accuracy sources, you will have to bear with some approximately inaccurate results
Upvotes: 1