Code example for LocationManager

Methods: addTestProvidersetTestProviderEnabled

0
		mListener = listener;
	} 
 
	public void initMOCKLocation() { 
		mocLocationProvider = LocationManager.GPS_PROVIDER;
		locationManager.addTestProvider(mocLocationProvider, false, false, false, false, true, true, true, 0, 5);
		locationManager.setTestProviderEnabled(mocLocationProvider, true);
		MockLocationWorking = true;
	} 
 
	public boolean isMockEnabled() { 
		try { 
			int mock_location = Settings.Secure.getInt(context.getContentResolver(), "mock_location");
			if (mock_location == 0) {
				try { 
					Settings.Secure.putInt(context.getContentResolver(), "mock_location", 1);
				} catch (Exception ex) {
				} 
				mock_location = Settings.Secure.getInt(context.getContentResolver(), "mock_location");
			}