Code example for LocationManager

Methods: getProviders

0
    /** 
     * This method checks to see what location providers are currently enabled 
     */ 
    protected void checkForProviders() 
    {    	 
    	gpsEnabled = locationManager.getProviders(true).contains(LocationManager.GPS_PROVIDER);              
        networkEnabled = locationManager.getProviders(true).contains(LocationManager.NETWORK_PROVIDER);        
    } 
     
    /** 
     * This method registers 
     */ 
    protected void registerListeners() 
    { 
        if(gpsEnabled==true)
        { 
            locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, minTime, minDistance, locationListener);
        } 
        if(networkEnabled==true)
        { 
            locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, minTime, minDistance, locationListener);