public static Observable<GeoData> create(final Context context) {
        final LocationManager geoManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
        final AtomicReference<Location> latestGPSLocation = new AtomicReference<>(null);
        final Observable<GeoData> observable = Observable.create(emitter -> {
            final Listener networkListener = new Listener(emitter, latestGPSLocation);
            final Listener gpsListener = new Listener(emitter, latestGPSLocation);
            final GeoData initialLocation = GeoData.getInitialLocation(context);
            if (initialLocation != null) {
                emitter.onNext(initialLocation);
            }
            Log.d("GeoDataProvider: starting the GPS and network listeners");
            try {
                geoManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, gpsListener);
            } catch (final Exception e) {
                Log.w("Unable to create GPS location provider: " + e.getMessage());
            }
            try {
                geoManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, networkListener);
            } catch (final Exception e) {
                Log.w("Unable to create network location provider: " + e.getMessage());
            }
            emitter.setDisposable(AndroidRxUtils.disposeOnCallbacksScheduler(() -> {
                geoManager.removeUpdates(networkListener);
                geoManager.removeUpdates(gpsListener);
            }));
        });
        return observable.subscribeOn(AndroidRxUtils.looperCallbacksScheduler).share().lift(new RxUtils.DelayedUnsubscription<>(2500, TimeUnit.MILLISECONDS));
    }
Provides access to Location Data (GNSS) via Android's Location Manager (Context.LOCATION_SERVICE)
main/src/main/java/cgeo/geocaching/sensors/GeoDataProvider.java