Example usage for android.location LocationProvider AVAILABLE

List of usage examples for android.location LocationProvider AVAILABLE

Introduction

In this page you can find the example usage for android.location LocationProvider AVAILABLE.

Prototype

int AVAILABLE

To view the source code for android.location LocationProvider AVAILABLE.

Click Source Link

Usage

From source file:org.path.episample.android.fragments.NavigateFragment.java

@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
    switch (status) {
    case LocationProvider.AVAILABLE:
        if (mDirectionProvider.getCurrentLocation() != null) {
            updateNotification();/*from   w  w  w  . j  av a2 s .c  om*/
        }
        break;
    case LocationProvider.OUT_OF_SERVICE:
        break;
    case LocationProvider.TEMPORARILY_UNAVAILABLE:
        break;
    }
}

From source file:biz.bokhorst.bpt.BPTService.java

@Override
public void onStatusChanged(String s, int i, Bundle b) {
    if (locating)
        if (i == LocationProvider.OUT_OF_SERVICE)
            sendStatus(getString(R.string.StatusNoService));
        else if (i == LocationProvider.TEMPORARILY_UNAVAILABLE)
            sendStatus(getString(R.string.StatusUnavailable));
        else if (i == LocationProvider.AVAILABLE)
            sendStatus(getString(R.string.StatusAvailable));
        else/* w  w  w  .j  a v  a  2 s .c  om*/
            sendStatus(String.format("Status %d", i));
}

From source file:org.cowboycoders.cyclisimo.turbo.TurboService.java

private boolean enableLocationProvider(String provider) {
    LocationManager locationManager = (LocationManager) getApplicationContext()
            .getSystemService(Context.LOCATION_SERVICE);
    if (locationManager.isProviderEnabled(provider)) {
        try {//ww  w  . j  av a2  s  . c  o m
            locationManager.addTestProvider(provider, "requiresNetwork" == "", "requiresSatellite" == "",
                    "requiresCell" == "", "hasMonetaryCost" == "", "supportsAltitude" == "",
                    "supportsSpeed" == "", "supportsBearing" == "", android.location.Criteria.POWER_LOW,
                    android.location.Criteria.ACCURACY_FINE);

            locationManager.setTestProviderEnabled(provider, true);
            locationManager.setTestProviderStatus(provider, LocationProvider.AVAILABLE, null,
                    System.currentTimeMillis());
        } catch (SecurityException e) {
            handleException(e, "Error enabling location provider", true, NOTIFCATION_ID_STARTUP);
            return false;
        }
    } else {
        return false;
    }

    return true;
}

From source file:net.e_fas.oss.tabijiman.MapsActivity.java

@Override
public void onStatusChanged(String provider, int status, Bundle extras) {

    e_print("onStatusChanged");

    switch (status) {
    case LocationProvider.AVAILABLE:
        e_print("AVAILABLE");
        break;//from  w  ww . j a  v  a 2  s.com
    case LocationProvider.OUT_OF_SERVICE:
        e_print("OUT_OF_SERVICE");
        break;
    case LocationProvider.TEMPORARILY_UNAVAILABLE:
        e_print("TEMPORARILY_UNAVAILABLE");
        break;

    }
}

From source file:jp.gr.java_conf.ya.shiobeforandroid3.UpdateTweetDrive.java

@Override
public final void onStatusChanged(final String provider, final int status, final Bundle extras) {
    String statusString = "Unknown";
    if (status == LocationProvider.AVAILABLE) {
        statusString = "AVAILABLE";
    } else if (status == LocationProvider.OUT_OF_SERVICE) {
        statusString = "OUT OF SERVICE";
    } else if (status == LocationProvider.TEMPORARILY_UNAVAILABLE) {
        statusString = "TEMP UNAVAILABLE";
    }//from   www . j a  va 2 s  . co  m
    toast("LocationProvider: " + statusString);
}

From source file:eu.basicairdata.graziano.gpslogger.GPSApplication.java

@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
    // This is called when the GPS status changes
    switch (status) {
    case LocationProvider.OUT_OF_SERVICE:
        //Log.w("myApp", "[#] GPSApplication.java - GPS Out of Service");
        gpsunavailablehandler.removeCallbacks(unavailr); // Cancel the previous unavail countdown handler
        GPSStatus = GPS_OUTOFSERVICE;// ww  w .j  av a2 s.  c  o m
        EventBus.getDefault().post(EventBusMSG.UPDATE_FIX);
        //Toast.makeText( getApplicationContext(), "GPS Out of Service", Toast.LENGTH_SHORT).show();
        break;
    case LocationProvider.TEMPORARILY_UNAVAILABLE:
        //Log.w("myApp", "[#] GPSApplication.java - GPS Temporarily Unavailable");
        gpsunavailablehandler.removeCallbacks(unavailr); // Cancel the previous unavail countdown handler
        GPSStatus = GPS_TEMPORARYUNAVAILABLE;
        EventBus.getDefault().post(EventBusMSG.UPDATE_FIX);
        //Toast.makeText( getApplicationContext(), "GPS Temporarily Unavailable", Toast.LENGTH_SHORT).show();
        break;
    case LocationProvider.AVAILABLE:
        gpsunavailablehandler.removeCallbacks(unavailr); // Cancel the previous unavail countdown handler
        //Log.w("myApp", "[#] GPSApplication.java - GPS Available: " + _NumberOfSatellites + " satellites");
        break;
    }
}

From source file:com.kll.collect.android.activities.FormEntryActivity.java

@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
    switch (status) {
    case LocationProvider.AVAILABLE:

        break;// w w w .j  a  v  a2  s .c om
    case LocationProvider.OUT_OF_SERVICE:
        break;
    case LocationProvider.TEMPORARILY_UNAVAILABLE:
        break;
    }
}