Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13: Working with Location Information > Selecting a Location Provider

Selecting a Location Provider

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.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint