Code example for LocationManager

Methods: addTestProvidersetTestProviderEnabled

0
	 
	@Override 
	protected void setUp() { 
	       mLocationHelper= new LocationHelper(getContext());
	       locationManager = (LocationManager) this.getContext().getSystemService(Context.LOCATION_SERVICE);
		   locationManager.addTestProvider("Test", false, false, false, false, false, false, false, Criteria.POWER_LOW, Criteria.ACCURACY_FINE);
		   locationManager.setTestProviderEnabled("Test", true);
	               
	    } 
	 
	@Override 
	protected void tearDown() { 
		locationManager.removeTestProvider("Test");
	} 
	 
	public void testLocationUpdate() { 
		// Arrange 
        Location location = new Location("Test");
        location.setLatitude(10.0);
        location.setLongitude(20.0);
Stop searching for code, let great code find you!  Add Codota to your java IDE