Android LocationProvider - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android LocationProvider class.

This code example shows how to use the following methods: getAccuracy, getName, getPowerRequirement, hasMonetaryCost, requiresCell
This code example shows how to use the following methods: getAccuracy, getName, getPowerRequirement, hasMonetaryCost, requiresCell
	/** Write information from a single location provider */ 
	private void dumpProvider(String provider) {
		LocationProvider info = mgr.getProvider(provider);
		StringBuilder builder = new StringBuilder();
		builder.append("LocationProvider[").append("name=")
				.append(info.getName()).append(",enabled=")
				.append(mgr.isProviderEnabled(provider))
				.append(",getAccuracy=").append(A[info.getAccuracy() + 1])
				.append(",getPowerRequirement=")
				.append(P[info.getPowerRequirement() + 1])
				.append(",hasMonetaryCost=").append(info.hasMonetaryCost())
				.append(",requiresCell=").append(info.requiresCell())
				.append(",requiresNetwork=").append(info.requiresNetwork())
				.append(",requiresSatellite=").append(info.requiresSatellite())
				.append(",supportsAltitude=").append(info.supportsAltitude())
				.append(",supportsBearing=").append(info.supportsBearing())
				.append(",supportsSpeed=").append(info.supportsSpeed())
				.append("]");
		log(builder.toString());
	} 

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
    boolean mSupportsBearing; 
    int mPowerRequirement; 
    int mAccuracy; 
 
    public DummyLocationProvider(String name, ILocationManager service) { 
        super(name, service); 
    } 
 
    public void setRequiresNetwork(boolean requiresNetwork) { 
        mRequiresNetwork = requiresNetwork; 
    } 
 
    public void setRequiresSatellite(boolean requiresSatellite) { 
        mRequiresSatellite = requiresSatellite; 
    } 
 
    public void setRequiresCell(boolean requiresCell) { 
        mRequiresCell = requiresCell; 
    } 
 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getAccuracy, getName, getPowerRequirement
		pos.put("coords", coords);
 
		if (provider != null) {
			TiDict p = new TiDict();
 
			p.put("name", provider.getName());
			p.put("accuracy", provider.getAccuracy());
			p.put("power", provider.getPowerRequirement());
 
			pos.put("provider", p);
		} 
 
		return pos;
	} 
 
	public boolean isLocationEnabled() { 
		boolean enabled = false;
 
		if (locationManager != null) {
			List<String> providers = locationManager.getProviders(true);
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getAccuracy, getName, getPowerRequirement
	} 
	 
	private void printProviderDetails(String provider)
	{ 
		LocationProvider info=locationManager.getProvider(provider);
		txtOutput.append("\n"+info.getName()+" "+info.getPowerRequirement()+" "+info.getAccuracy());
	} 
 
	@Override 
	protected void onResume() { 
		super.onResume(); 
		locationManager.requestLocationUpdates(provider, 1000, 0.0f, this);
 
		Location currentLocation = locationManager
				.getLastKnownLocation(provider);
		if (currentLocation != null) {
			double latitude = currentLocation.getLatitude();
			double longitude = currentLocation.getLongitude();
			String provider = currentLocation.getProvider();
			txtOutput.append("\nLocation update from " + provider + ": Lat:"
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android LocationProvider Questions & Answers:

See Code Examples for Android LocationProvider Methods: