package net.kjulio.rxlocation;

import android.content.Context;
import android.location.Location;

import com.google.android.gms.location.LocationRequest;

import rx.Observable;

/**
 * RxLocation.
 *
 * An easy to use Android library to get location data in an RxJava way.
 *
 * https://github.com/julioromano/RxLocation
 */
public class RxLocation {

    private RxLocation() {}

    /**
     * Clients subscribe to get location updates via this method.
     *
     * This observable will never call onComplete() thus manual unsubscribe() is necessary.
     *
     * When using setExpirationDuration() or setNumUpdates() or setExpirationTime() the observable
     * will not terminate automatically and will just stop emitting new items without releasing any
     * resources.
     *
     * @return an Observable that returns Location items.
     */
    public static Observable<Location> locationUpdates(Context context,
                                                          LocationRequest locationRequest) {
        return LocationUpdatesHelper.observable(context, new GoogleApiClientFactoryImpl(),
                new FusedLocationProviderFactoryImpl(), locationRequest);
    }

    public static Observable<Location> lastLocation(Context context) {
        return LastLocationHelper.observable(context, new GoogleApiClientFactoryImpl(),
                new FusedLocationProviderFactoryImpl());
    }

}

@@ -267,19 +267,16 @@
 va way.%0A
- *%0A
  * https
@@ -318,138 +318,1609 @@
 n%0A *
-/%0Apublic class RxLocation %7B%0A%0A    private RxLocation() %7B%7D%0A%0A    /**%0A     * Clients subscribe to get location updates via this method
+%0A *%0A * All public methods of the library have a static and non-static version.%0A *%0A * The static methods can be invoked straight away:%0A * Observable%3CLocation%3E o = RxLocation.lastLocation(context);%0A *%0A * The non-static methods require an RxLocation instance instead:%0A * RxLocation rxLocation = new RxLocation(context);%0A * Observable%3CLocation%3E o = rxLocation.lastLocation();%0A *%0A * The library is stateless: there is no difference in using the static vs non-static version.%0A */%0Apublic class RxLocation %7B%0A%0A    private final Context context;%0A%0A    public RxLocation(Context context) %7B%0A        this.context = context;%0A    %7D%0A%0A    /**%0A     * Yields periodical location updates.%0A     *%0A     * This observable will never call onComplete() thus manual unsubscribe() is necessary.%0A     *%0A     * When using setExpirationDuration() or setNumUpdates() or setExpirationTime() the observable%0A     * will not terminate automatically and will just stop emitting new items without releasing any%0A     * resources.%0A     *%0A     * @return an Observable that returns Location items.%0A     */%0A    public Observable%3CLocation%3E locationUpdates(LocationRequest locationRequest) %7B%0A        return RxLocation.locationUpdates(context, locationRequest);%0A    %7D%0A%0A    /**%0A     * Yields the last location available to the system.%0A     *%0A     * This observable will emit only one element and then call onComplete.%0A     *%0A     * @return an Observable that returns one Location item.%0A     */%0A    public Observable%3CLocation%3E lastLocation() %7B%0A        return RxLocation.lastLocation(context);%0A    %7D%0A%0A    /**%0A     * Yields periodical location updates
 .%0A  
@@ -2646,24 +2646,248 @@
 st);%0A    %7D%0A%0A
+    /**%0A     * Yields the last location available to the system.%0A     *%0A     * This observable will emit only one element and then call onComplete.%0A     *%0A     * @return an Observable that returns one Location item.%0A     */%0A
     public s

Allow use of library also in non static form (i.e. allow instantiation of RxLocation stateless class and expose non static methods that wrap the static ones.)