LocationManager isProviderEnabled - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for LocationManager isProviderEnabled method.

This code example shows how to use the following methods:getLastKnownLocation, isProviderEnabled, requestLocationUpdates
	 
	 
	@Override 
	public void async(Context context){
		lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);		
		gpsEnabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
		networkEnabled = lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
		work(); 
	} 
	 
	public LocationAjaxCallback timeout(long timeout){
		this.timeout = timeout;
		return this;
	} 
	 
	public LocationAjaxCallback accuracy(float accuracy){
		this.accuracy = accuracy;
		return this;
	} 
	 

9
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLastKnownLocation, isProviderEnabled, requestLocationUpdates
			locationManager = (LocationManager) mContext
					.getSystemService(LOCATION_SERVICE);
 
			// getting GPS status 
			isGPSEnabled = locationManager
					.isProviderEnabled(LocationManager.GPS_PROVIDER);
 
			// getting network status 
			isNetworkEnabled = locationManager
					.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
 
			if (!isGPSEnabled && !isNetworkEnabled) {
				// no network provider is enabled 
			} else { 
				this.canGetLocation = true;
				if (isNetworkEnabled) {
					locationManager.requestLocationUpdates(
							LocationManager.NETWORK_PROVIDER,
							MIN_TIME_BW_UPDATES,
							MIN_DISTANCE_CHANGE_FOR_UPDATES, this);

8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLastKnownLocation, isProviderEnabled, requestLocationUpdates
     * @param myLocationFoundListener the callback 
     */ 
    public void requestLocationUpdates(MyLocationFoundListener myLocationFoundListener) {
        mMyLocationFoundListener = myLocationFoundListener;
 
        if (mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
            mGpsLocationListener = new MyLocationListener();
            mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
                    0, 0, mGpsLocationListener);
        } 
 
        if (mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {
            mNetworkLocationListener = new MyLocationListener();
            mLocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,
                    0, 0, mNetworkLocationListener);
        } 
 
        if (mNetworkLocationListener != null || mGpsLocationListener != null) {
            mLocationRequestTimeOut.start();
        } else { 

8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isProviderEnabled
	} 
	 
	public boolean isGpsLocationServiceActive() { 
		boolean gps_enabled = false;
		try { 
			gps_enabled = androidLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
		} catch (Exception ex) {
		} 
		return gps_enabled;
	} 
	 
	public boolean isNetworkLocationServiceActive() { 
		boolean network_enabled = false;
		try { 
			network_enabled = androidLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
		} catch (Exception ex) {
		} 
		return network_enabled;
	} 
 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLastKnownLocation, isProviderEnabled
		mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
	} 
	 
	private boolean isGpsLocationProviderEnabled() { 
		try { 
        	return mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
        } catch (Exception e) {
        	DebugLog.d(TAG, e.getMessage());
        } 
		 
		return false; 
	} 
	 
	private boolean isNetworkLocationProviderEnabled() { 
		try { 
        	return mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
        } catch (Exception e) {
        	DebugLog.d(TAG, e.getMessage());
        } 
		 

5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLastKnownLocation, isProviderEnabled, requestLocationUpdates
			locationManager = (LocationManager) mContext
					.getSystemService(LOCATION_SERVICE);
 
			// getting GPS status 
			isGPSEnabled = locationManager
					.isProviderEnabled(LocationManager.GPS_PROVIDER);
 
			// getting network status 
			isNetworkEnabled = locationManager
					.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
 
			if (!isGPSEnabled && !isNetworkEnabled) {
				// no network provider is enabled 
			} else { 
				this.canGetLocation = true;
				if (isNetworkEnabled) {
					locationManager.requestLocationUpdates(
							LocationManager.NETWORK_PROVIDER,
							MIN_TIME_BW_UPDATES,
							MIN_DISTANCE_CHANGE_FOR_UPDATES, this);

8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getBestProvider, getLastKnownLocation, isProviderEnabled, requestLocationUpdates
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLastKnownLocation, isProviderEnabled, requestLocationUpdates
        locationManager = (LocationManager) mContext
                .getSystemService(LOCATION_SERVICE);
 
        // getting GPS status 
        isGPSEnabled = locationManager
                .isProviderEnabled(LocationManager.GPS_PROVIDER);
 
        // getting network status 
        isNetworkEnabled = locationManager
                .isProviderEnabled(LocationManager.NETWORK_PROVIDER);
 
        if (!isGPSEnabled && !isNetworkEnabled) {
            // no network provider is enabled 
        } else { 
            this.canGetLocation = true;
            if (isNetworkEnabled) {
                locationManager.requestLocationUpdates(
                        LocationManager.NETWORK_PROVIDER,
                        MIN_TIME_BW_UPDATES,
                        MIN_DISTANCE_CHANGE_FOR_UPDATES, this);

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLastKnownLocation, isProviderEnabled, requestLocationUpdates
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLastKnownLocation, isProviderEnabled, requestLocationUpdates
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related LocationManager isProviderEnabled Questions & Answers:

Other LocationManager isProviderEnabled Examples

51:				// getting GPS status
52:				isGPSEnabled = locationManager
53:						.isProviderEnabled(LocationManager.GPS_PROVIDER);
54:	
55:				// getting network status
-
55:				// getting network status
56:				isNetworkEnabled = locationManager
57:						.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
58:	
59:				if (!isGPSEnabled && !isNetworkEnabled) {

Read More

51:				// getting GPS status
52:				isGPSEnabled = locationManager
53:						.isProviderEnabled(LocationManager.GPS_PROVIDER);
54:	
55:				// getting network status
-
55:				// getting network status
56:				isNetworkEnabled = locationManager
57:						.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
58:	
59:				if (!isGPSEnabled && !isNetworkEnabled) {

Read More

isProviderEnabled Method Overview
Returns the current enabled/disabled status of the given provider.
See Code Examples for other Android LocationManager Methods: