What methods does Google use to match IP addresses to approximate location inside a building using wifi or service-provider?
The actual location identification method is abstracted away. Developers are to only concern themselves with the source.
The NETWORK_PROVIDER source uses the IP Address and Cellular triangulation to identify the user's location.
http://developer.android.com/reference/android/location/LocationManager.html#NETWORK_PROVIDER
Also the method getLastKnownLocation(best) that provides the LocationManager can be used, as GPS won't work indoors. It is not accurate, but it will give a location of a big area.
Related
I see that LocationManager.NETWORK_PROVIDER.getLastKnownLocation() returns the last location, but how is the location updated? If the GPS is disabled, will it entirely rely on BSSIDs detected by WiFi? What if the WiFi is also disabled? Does it take mobile service tower data into account?
Yes, the location service has basically three levels: GPS, WiFi, Cell tower.
GPS is used with the GPS_PROVIDER, and WiFi and cell tower go both into the NETWORK_PROVIDER bucket.
To quote the NETWORK_PROVIDER description:
This provider determines location based on availability of cell tower and WiFi access points. Results are retrieved by means of a network lookup.
I used an android smartphone in the following situation:
without SIM-Card
connected to a WLAN
located in an indoor environment (GPS does not work)
located somewhere other than the address probabely set in google account
for positioning in Google-Maps App. The result was roughly correct (about 15 meters error).
There is no GPS signals to get position.
Thre is no SIM-Card. So using Cell ID is impossible.
It means the only resource from which my position is achieved is internet. Could anybody explain to me (while I couldn't find anything in internet) how this is possible?
Google gathers information on the SSID of WiFi hotspots. They drive around with cars gathering street views for their maps and other information like the location of WiFi hotspotes. They store it in a data base somewhere and when you ask for your location it will find out the SSIDs of every WiFi hotspote around you and then give a rough estimate based on signal strength and other information.
Google might use people's cell phones to gather WiFi SSID information as well I am not really sure about that though. I think this because there are setting in most android phones asking to help Google for accuracy using WiFi...
Other sites use public ISP information obtained by IP address but this is not as reliable as it gives the location of your ISP (Internet Service Provider).
Here is a site where many people are discussing this topic.
Here is a site that teaches how Google finds location data through SSID
Here is a site that teaches how geolocation software finds ISP location
Google, apart from other ways, uses SSID of the nearby networks to get your position. AFAIR there was a big concern about Google Street View Cars scanning for wifi networks, recording SSIDs for location purposes. If that SSID is not registered, they probably use some kind of IP location service, based on network provider ip address pool.
See Google maps Android API getting wifi location for more details about getting that information from Android.
Android may use wifi and sensors in order to get your position. The more wifi routers around - the more accurate your position.
I am trying to get the user's current location using phonegap Geolocation api, which says "Common sources of location information include Global Positioning System (GPS) and location inferred from network signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs". I am able to properly get the location when internet is ON (irrespective of the state of GPS).
Is there a way to get the location using triangulation when the internet is OFF or not accessible? (GPS might be ON or OFF)
A BIG "NO"! This is like cutting down hands and asking if I could clap now? GPS and NETWORK location providers are the only way to receive user device location.
For GPS location - you need GPS sensors to be ON.
And for NETWORK location you need to have internet connection ON, because in this case the location is calculated on the basis of Cell-Tower/Wifi-spot ID which is then sent to google servers (via internet) to fetch the location details of the respective Cell Tower or wifi spot. Google's location server have its own location approximation algorithms on the basis of which it tells your location.
So, there could be no way you could receive a location when both GPS and INTERNET are OFF.
Note: You can still get the last received location from any of these providers by using LocationManager's getLastKnownLocation() even when the providers are OFF. But this locations are usually outdated ones and are barely of any use.
{ enableHighAccuracy: true }
Enabling that option will allow the Android device to get the location even with the WIFI option disabled.
Is there a way to get the Location (latitude, longitude) of an wifi access point? I need to display them on a map so the only way for me to do that is to get the location of each wifi access point.
Thanks.
You need to use a database of access points for this, such as the one at WiGLE.net.
Contact them for information on a commercial license.
Routers don't typically have GPS capabilities. You can determine the geographic location roughly using a reverse IP lookup and a geographic ISP database.
You might be able to estimate a distance away from the user using signal strength...
I try to receive latitude & longitude on android phone.
Is location on android receive directly from satellite?
Why it dynamic all the time, while I standing though?
So, anyone know how to make it stable ?
Thanks
The location may come from a variety of places:
The "last-known" location, an OS-level cached location (fast, but may be inaccurate)
The wifi network (Google can often deduce location from the wifi net you're on, but not always)
Mobile network - if the device is on a mobile phone network, that can provide location information
GPS receiver. If the device is outdoors this will provide the most accurate location
Your app will have specific needs, and so you need to decide which locations you want, and what you do when you get them, based on their accuracy, and the source.
With GPS, buildings, tees, the weather, etc will all have an effect on the location, so you'll never get one amazingly accurate location. Many apps just request a location and use it, but if you need accurate, stable location data, you need to collect data from relevant sources, and then use your own algorithm to decide which to use.
You need to read, understand, and use what's in this page:
http://developer.android.com/guide/topics/location/obtaining-user-location.html