Code example for LocationManager

Methods: getProviders

0
			wakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "Fe-Fi");
			locationManager = (LocationManager)getSystemService(LOCATION_SERVICE);
			criteria = new Criteria();
			criteria.setAccuracy(Criteria.ACCURACY_FINE);
			criteria.setPowerRequirement(Criteria.POWER_HIGH);
			List<String> providers = locationManager.getProviders(criteria, true);
			if(providers.size() > 0) {
				provider = providers.get(0);
			} else { 
				Log.e(TAG, "Couldn't find a GPS provider, guessing");
				provider = "GPS";
			} 
			db = getDatabase();
		} 
		 
		private boolean updating = false;
		 
		public synchronized void poke() { 
			if(!getSharedPreferences(PREFS, Context.MODE_PRIVATE)
					.getBoolean("enable_geotag", false)) {
				return;