Code example for LocationManager

Methods: addTestProvidergetProvider

0
			this.locationListener = new DummyLocationListener(context);
		} 
		this.locationManager = (LocationManager) context
				.getSystemService(Context.LOCATION_SERVICE);
		try { 
			if (locationManager.getProvider(MockLocationReceiver.MOCK_PROVIDER) == null) {
				locationManager.addTestProvider(
						MockLocationReceiver.MOCK_PROVIDER, true, false, false,
						false, false, false, false, Criteria.POWER_LOW,
						Criteria.ACCURACY_FINE);
			} 
		} catch (SecurityException e) {
			Log.i(TAG,
					"SecurityException thrown when switching to mock location."); 
		} 
 
		this.url = makeURLForGetPosition(context);
 
		this.mockLocationReceiver = new MockLocationReceiver();
	}