List of usage examples for android.location GpsStatus GPS_EVENT_FIRST_FIX
int GPS_EVENT_FIRST_FIX
To view the source code for android.location GpsStatus GPS_EVENT_FIRST_FIX.
Click Source Link
From source file:de.bogutzky.psychophysiocollector.app.MainActivity.java
private void startStreamingInternalSensorData() { internalSensorManager = new InternalSensorManager(root, new int[] { 1000, 1000, 1000 }, this); internalSensorManager.startStreaming(); locationListener = new GPSListener(getString(R.string.file_name_gps_position), this.directoryName, 25, this); if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[] { android.Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION }, PERMISSIONS_REQUEST);/*w w w.ja va 2 s.co m*/ } else { locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener); locationManager.addGpsStatusListener(new GpsStatus.Listener() { @Override public void onGpsStatusChanged(int event) { switch (event) { case GpsStatus.GPS_EVENT_STARTED: gpsStatusText = getString(R.string.info_connected); break; case GpsStatus.GPS_EVENT_STOPPED: gpsStatusText = getString(R.string.info_not_connected); break; case GpsStatus.GPS_EVENT_FIRST_FIX: gpsStatusText = getString(R.string.info_connected_fix_received); break; } } }); } }