List of usage examples for android.location LocationProvider TEMPORARILY_UNAVAILABLE
int TEMPORARILY_UNAVAILABLE
To view the source code for android.location LocationProvider TEMPORARILY_UNAVAILABLE.
Click Source Link
From source file:org.runnerup.tracker.GpsStatus.java
@Override public void onStatusChanged(String provider, int status, Bundle extras) { if (provider.equalsIgnoreCase("gps")) { if (status == LocationProvider.OUT_OF_SERVICE || status == LocationProvider.TEMPORARILY_UNAVAILABLE) { clear(true);/*from w w w . j ava 2 s . c o m*/ } if (listener != null) listener.onTick(); } }
From source file:com.nextgis.firereporter.SendReportActivity.java
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.report);//from ww w . j a v a2 s .c o m //add fragment FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); frCompass = (CompassFragment) getSupportFragmentManager().findFragmentByTag("COMPASS"); if (frCompass == null) { frCompass = new CompassFragment(); fragmentTransaction.add(R.id.compass_fragment_container, frCompass, "COMPASS").commit(); } getSupportFragmentManager().executePendingTransactions(); getSupportActionBar().setHomeButtonEnabled(true); edLatitude = (EditText) findViewById(R.id.edLatitude); edLongitude = (EditText) findViewById(R.id.edLongitude); edAzimuth = (EditText) findViewById(R.id.edAzimuth); edDistance = (EditText) findViewById(R.id.edDistance); edComment = (EditText) findViewById(R.id.edComment); edDistance.setText("100"); mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); if (mLocationManager != null) { for (String aProvider : mLocationManager.getProviders(false)) { if (aProvider.equals(LocationManager.GPS_PROVIDER)) { gpsAvailable = true; } } if (gpsAvailable) { Location location = mLocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); if (location != null) { float lat = (float) (location.getLatitude()); float lon = (float) (location.getLongitude()); edLatitude.setText(Float.toString(lat)); edLongitude.setText(Float.toString(lon)); } else { edLatitude.setText(getString(R.string.noLocation)); edLongitude.setText(getString(R.string.noLocation)); } mLocationListener = new LocationListener() { public void onStatusChanged(String provider, int status, Bundle extras) { switch (status) { case LocationProvider.OUT_OF_SERVICE: break; case LocationProvider.TEMPORARILY_UNAVAILABLE: break; case LocationProvider.AVAILABLE: break; } } public void onProviderEnabled(String provider) { } public void onProviderDisabled(String provider) { } public void onLocationChanged(Location location) { float lat = (float) (location.getLatitude()); float lon = (float) (location.getLongitude()); edLatitude.setText(Float.toString(lat)); edLongitude.setText(Float.toString(lon)); // FIXME: also need to calculate declination? } }; // location listener } else { edLatitude.setText(getString(R.string.noGPS)); edLongitude.setText(getString(R.string.noGPS)); edLatitude.setEnabled(false); edLongitude.setEnabled(false); } } mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE); boolean accelerometerAvailable = false; boolean magnetometerAvailable = false; for (Sensor aSensor : mSensorManager.getSensorList(Sensor.TYPE_ALL)) { if (aSensor.getType() == Sensor.TYPE_ACCELEROMETER) { accelerometerAvailable = true; } else if (aSensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) { magnetometerAvailable = true; } } compassAvailable = accelerometerAvailable && magnetometerAvailable; if (compassAvailable) { //frCompass = (CompassFragment) getSupportFragmentManager().findFragmentByTag("COMPASS"); if (frCompass != null) { frCompass.SetAzimuthCtrl(edAzimuth); } } else { edAzimuth.setText(getString(R.string.noCompass)); edAzimuth.setEnabled(false); } }
From source file:com.alexandreroman.nrelay.NmeaRelayService.java
@Override public void onStatusChanged(String provider, int status, Bundle extras) { if (LocationManager.GPS_PROVIDER.equals(provider)) { if (LocationProvider.TEMPORARILY_UNAVAILABLE == status) { Log.i(TAG, "GPS is temporarily unavailable"); updateState(State.WAITING_FOR_GPS_FIX); }/*from w w w .j a va 2s.c om*/ } }
From source file:prgc.snct.sos.Activities.MapActivity2.java
@Override public void onStatusChanged(String provider, int status, Bundle extras) { switch (status) { case LocationProvider.AVAILABLE: Log.v("Status", "AVAILABLE"); break;/*from w w w . j a v a2 s . c om*/ case LocationProvider.OUT_OF_SERVICE: Log.v("Status", "OUT_OF_SERVICE"); break; case LocationProvider.TEMPORARILY_UNAVAILABLE: Log.v("Status", "TEMPORARILY_UNAVAILABLE"); break; } }
From source file:tcc.iesgo.activity.ClientMapActivity.java
@Override public void onStatusChanged(String provider, int status, Bundle extras) { switch (status) { case LocationProvider.OUT_OF_SERVICE: //Log.v(tag, "Status alterado: Fora de servio"); break;//from w w w. j a v a 2s .c o m case LocationProvider.TEMPORARILY_UNAVAILABLE: //Log.v(tag, "Status alterado: Temporariamente indisponvel"); break; case LocationProvider.AVAILABLE: //Log.v(tag, "Status alterado: Disponvel"); break; } }
From source file:gov.nasa.arc.geocam.geocam.GeoCamMobile.java
private void updateLocation(Location location) { double lat, lon; int status;// w ww . j a v a 2s . c om if (location == null) { lat = 0.0; lon = 0.0; status = LocationProvider.TEMPORARILY_UNAVAILABLE; } else { mLocation = location; mLocationProvider = mLocation.getProvider(); status = LocationProvider.AVAILABLE; lat = mLocation.getLatitude(); lon = mLocation.getLongitude(); } NumberFormat nf = NumberFormat.getInstance(); nf.setMaximumFractionDigits(6); TextView latText = (TextView) findViewById(R.id.main_latitude_textview); TextView lonText = (TextView) findViewById(R.id.main_longitude_textview); latText.setText(nf.format(lat) + DEGREE_SYMBOL); lonText.setText(nf.format(lon) + DEGREE_SYMBOL); ((TextView) findViewById(R.id.main_location_provider_textview)).setText(mLocationProvider); TextView locationStatusText = ((TextView) findViewById(R.id.main_location_status_textview)); switch (status) { case LocationProvider.AVAILABLE: locationStatusText.setText("available"); break; case LocationProvider.TEMPORARILY_UNAVAILABLE: locationStatusText.setText("unavailable"); break; case LocationProvider.OUT_OF_SERVICE: locationStatusText.setText("no service"); break; default: locationStatusText.setText("unknown"); break; } }
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();//w w w.j a va 2 s . co m } 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. ja v a2s . c om*/ sendStatus(String.format("Status %d", i)); }
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 . java 2 s.c o m 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 w ww . ja v a 2 s . c o m*/ toast("LocationProvider: " + statusString); }