Skip to content

Instantly share code, notes, and snippets.

Last active May 23, 2016
What would you like to do?
Gist detail how we use Fused Location Provid

Build google api client:

m_googleApiClient = builder.

The location request looks like this:

LocationRequest locationRequest = LocationRequest.create();

When connected

    public void onConnected(Bundle bundle) {
      m_fusedLocationProviderApi.requestLocationUpdates(m_googleApiClient, m_locationRequest, this);

We listen for callbacks:

    public void onLocationChanged(Location location) {
      m_lastUpdate =
      m_location = location;

We find that occaisionally onLocationChanged stops getting called. We track this by periodically checking if the m_lastUpdate value has been updated. We also listen for failure callbacks but we almost never see those being called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment