Книга: Beginning Android
Location Providers: They Know Where You’re Hiding
Location Providers: They Know Where You’re Hiding
Android devices can have access to several different means of determining your location. Some will have better accuracy than others. Some may be free, while others may have a cost associated with them. Some may be able to tell you more than just your current position, such as your elevation over sea level, or your current speed.
Android, therefore, has abstracted all this out into a set of LocationProvider
objects. Your Android environment will have zero or more LocationProvider
instances, one for each distinct locating service that is available on the device. Providers know not only your location, but their own characteristics, in terms of accuracy, cost, etc.
You, as a developer, will use a LocationManager
, which holds the LocationProvider
set, to figure out which LocationProvider
is right for your particular circumstance. You will also need the ACCESS_LOCATION
permission in your application, or the various location APIs will fail due to a security violation. Depending on which location providers you wish to use, you may need other permissions as well, such as ACCESS_COARSE_LOCATION
or ACCESS_FINE_LOCATION
.
- CHAPTER 33 Accessing Location-Based Services
- Appendix F. Acknowledgments
- Where to get iptables
- Internet Service Providers who use assigned IP addresses
- Who did What, Where?
- Who Did What, Where?
- QueryInterface и IUnknown
- Снова IUnknown
- Printing the Location of a Command with which
- Acknowledgments
- 4.3. PROCESSOR ALLOCATION
- 4.3.1. Allocation Models