Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
As noted earlier in the chapter, Android devices can use multiple technologies to determine the device's current location. These technologies vary according to the device. Each technology has capabilities that function differently in terms of power consumption, accuracy, device heading, altitude, and other items.
To get an instance of a specific provider, calling LocationManager's .GetProvider method and passing the provider's name returns an instance:
String providerName = LocationManager.GpsProvider; LocationProvider gpsProvider; String serviceString = Context.LocationService; lm = (LocationManager)GetSystemService(serviceString); gpsProvider = (lm.GetProvider(providerName));
This can be useful for obtaining the features and abilities of a given provider.