Android Open Source - SurgePriceWidget Current Location Client






From Project

Back to project page SurgePriceWidget.

License

The source code is released under:

MIT License

If you think the Android project SurgePriceWidget listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package me.mattlogan.surgepricewidget.location;
//w ww  . j av a  2  s  .c o m
import android.content.Context;
import android.os.Bundle;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesClient;
import com.google.android.gms.location.LocationClient;

import me.mattlogan.surgepricewidget.location.event.LocationClientConnectedEvent;

public class CurrentLocationClient {

    static LocationClient locationClient;

    public static LocationClient getClient(Context context) {
        if (locationClient == null) {
            locationClient = new LocationClient(
                    context.getApplicationContext(), callbacks, failureListener);
        }
        return locationClient;
    }

    static GooglePlayServicesClient.ConnectionCallbacks callbacks =
            new GooglePlayServicesClient.ConnectionCallbacks() {
                @Override public void onConnected(Bundle bundle) {
                    LocationBus.getInstance().post(new LocationClientConnectedEvent());
                }

                @Override public void onDisconnected() {

                }
            };

    static GooglePlayServicesClient.OnConnectionFailedListener failureListener =
            new GooglePlayServicesClient.OnConnectionFailedListener() {
                @Override public void onConnectionFailed(ConnectionResult connectionResult) {

                }
            };
}




Java Source Code List

me.mattlogan.surgepricewidget.ApplicationTest.java
me.mattlogan.surgepricewidget.SurgePriceWidgetApplication.java
me.mattlogan.surgepricewidget.api.UberApiBus.java
me.mattlogan.surgepricewidget.api.UberApiHandler.java
me.mattlogan.surgepricewidget.api.UberApi.java
me.mattlogan.surgepricewidget.api.event.RetrievePricesFailedEvent.java
me.mattlogan.surgepricewidget.api.event.RetrievePricesRequestedEvent.java
me.mattlogan.surgepricewidget.api.event.RetrievePricesSuccessEvent.java
me.mattlogan.surgepricewidget.api.model.PriceListWrapper.java
me.mattlogan.surgepricewidget.api.model.Price.java
me.mattlogan.surgepricewidget.location.CurrentLocationClient.java
me.mattlogan.surgepricewidget.location.LocationBus.java
me.mattlogan.surgepricewidget.location.event.LocationClientConnectedEvent.java
me.mattlogan.surgepricewidget.widget.SurgePriceWidgetProvider.java