Code example for LocationClient

Methods: requestLocationUpdates

0
    @Override 
    public void onConnected(Bundle connectionHint) {
        Log.i(TAG, "connected");
        LocationRequest locationRequest = LocationRequest.create();
        locationRequest.setInterval(TIMEOUT);
        mLocationclient.requestLocationUpdates(locationRequest, this);
    } 
 
    @Override 
    public void onDisconnected() { 
        Log.i(TAG, "disconnected");
    } 
 
    @Override 
    public void onConnectionFailed(ConnectionResult result) {
        Log.i(TAG, "failed");
        if (mLocationObtainedListener != null) {
            mLocationObtainedListener.onLocationObtained(null);
        } 
        mLocationclient.disconnect();
    }