Code example for LocationManager

Methods: getProviders

0
 
    public boolean locactionServiceAvaiable() {   
 
        LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);  
 
        List<String> providers = lm.getProviders(true);   
    	     
        if(providers.size()>0) return true; else return false;  
 
    }   
     
    private double[] getGPS() {   
 
        LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);    
 
        List<String> providers = lm.getProviders(true);  
       
        /* Loop over the array backwards, and if you get an accurate location, then break out the loop*/   
        Location l = null;  
           
Stop searching for code, let great code find you!  Add Codota to your java IDE