Finding the Available Providers

The LocationManager class includes static string constants that return the provider name for the two most common Location Providers:

> LocationManager.GPS_PROVIDER

> LocationManager.NETWORK_PROVIDER

To get a list of names for all the providers available on the device, call getProviders, using a Boolean to indicate if you want all, or only the enabled, providers to be returned:

boolean enabledOnly = true;

List<String> providers = locationManager.getProviders(enabledOnly);

Mobile Apps Made Easy

Mobile Apps Made Easy

Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.

Get My Free Training Guide

Post a comment