Location is a difficult task when you have limited battery life, and when there are no GPS signals in buildings and areas with a large building, etc. But Android makes it a lot easier. When you request a location, you just need to indicate what accuracy you need.
If you indicate that you want to use accuracy for the example *100 meters* , Android will try to get the location, and if it can get a place for an accuracy of 70 meters, it will return it to you, but if Android can get a place with an accuracy of more than 100 meters, your the application will wait and receive nothing until there is such a location with such accuracy.
Typically, Android will first get the cell ID, and then send it to the Google server, which displays such cell IDs, and the server will return latitude and longitude with low accuracy, for example, 1000 meters. By this time, Android will also try to see all Wi-Fi networks in this region, and also send information about them to the Google server, and, if possible, the Google server will return the new location with higher accuracy for an example of 800 meters.
By this time GPS will be turned on. A GPS device needs at least 30 seconds from a cold start to get a fix, so if you can fix it, it will return the latitude and longitude, but again with an accuracy that will be as high as possible for an example of 100 meters. The longer GPS works, the better you get.
Important Note: The first two methods require an Internet connection. If there is no connection, you will have to wait for GPS, but if the device is in the building, you probably will not get any space.
vendor Mar 24 '11 at 18:30 2011-03-24 18:30
source share