Questions tagged [location-client]

The LocationClient is the main entry point for location related APIs, such as location and geofence.

The LocationClient is the main entry point for location related APIs, such as location and geofence.

Use the LocationClient to:

  • Connect and disconnect to Google Location Services.
  • Request/remove location update callbacks.
  • Request/remove geofences.

  • 84 questions
    23
    votes
    2 answers

    Do Geofences remain active in android after a device reboot

    I'm writing an application that needs to use geofencing for when someone enters/exits multiple sites over the lifetime of the application being installed. My implementation of geofencing (very similar to the second link below) is all working fine…
    20
    votes
    7 answers

    onLocationChanged not called on some devices

    This is a question which has been asked numerous times but I could not find a solution that always works. I am developing an application using the Fused location provider. In the onConnected() method, I am requesting for location updates and the…
    Rohit
    • 261
    • 3
    • 9
    12
    votes
    1 answer

    Android geofencing API BroadcastReceiver not triggered

    I am trying to use the geofencing api from the google play services but I can't manage to get my broadcast receiver trigger its onReceive() method. It looks like I respect everything that is needed to make it work but I get no transition event. I…
    9
    votes
    2 answers

    Activity Recognition stops receiving updates when phone goes to standby(screen off state)

    I am having some trouble with activity recognition. I have implemented it in an app and it works fine when the device's screen is on. I have a log entry in my Activity recognition intent service class and I can see when it gets an update.So, I know…
    9
    votes
    1 answer

    Google location API: request location updates with pending intent?

    I have started to implement the Google Location API using this tutorial. I've managed to get it to work in my application quite fine, it updates my location at the right intervals etc. Now I am working on how to update my location when the device is…
    8
    votes
    4 answers

    Do Android Geofences remain active until removed/expired or only until my PendingIntent is launched

    I'm about to implement a feature with geofences and before I get any serious work done, I need to know whether geofences remain active after the first transition. The core of the feature is: every time I'm within x meters of point P (call this…
    8
    votes
    1 answer

    Checking GPS status with Google Play Services

    Google recommends now using Google Play Services to manage user location. But how can we, using this API, check wether GPS is turned on in device or if we still have gps connection? In com.google.android.gms.location.LocationListener we have only…
    Kamil Lelonek
    • 13,631
    • 10
    • 60
    • 87
    7
    votes
    1 answer

    Is there an alternative to Location Client (Google Play API)?

    I work on an app that uses location data, and it needs to work in China. Android devices sold here largely don't have Google Play API installed at all and the only way is to root the phone to install it. So I'm stuck with LocationManager which works…
    6
    votes
    3 answers

    Cannot resolve symbol 'LocationClient' in Android Studio

    I'm getting this error developing an application in Android Studio that I would like to use location services in.I know this question has been asked before but I beleive the previous was with an app developed in Eclipse. I beleive this may be an…
    6
    votes
    3 answers

    The import com.google.android.gms.location.LocationClient cannot be resolved after formatting computer

    I formatted my computer and again imported my android project which has been done using Google Maps API V2 and found out many errors.I re-linked google_play_services_lib and android-support-v7-appcompat.I still find an error in importing…
    6
    votes
    3 answers

    LocationClient auto reconnect at `onDisconnect`

    I tried to reconnect to LocationClient when the connection gets lost (When user clear the RAM). I tried to use this code: private final GooglePlayServicesClient.ConnectionCallbacks mConnectionCallback = new…
    nrofis
    • 7,124
    • 9
    • 44
    • 90
    6
    votes
    1 answer

    LocationClient requestUpdates onLocationChanged never called

    I have this code which I use to position a map app. I tested it in a Galaxy S2 device and works fine, but when I tested it in a nexus 4 device the onLocationChanged callback never gets called. What could I be doing wrong? Here is my activity code: …
    danielrvt-sgb
    • 1,088
    • 5
    • 16
    • 33
    5
    votes
    1 answer

    getTriggeringGeofences and getGeofenceTransition from LocationServices

    I noticed that the LocationClient class has currently been deprecated. I was using it for a travel app. and I changed the logic to use LocationServices instead of…
    5
    votes
    1 answer

    Multiple LocationClients interfering?

    I'm working on an app which consists of a service and an activity. The service uses a LocationClient-object to request the current location every minute. The activity uses another LocationClient-object to request a single current location after a…
    Biggie
    • 6,647
    • 10
    • 30
    • 39
    4
    votes
    1 answer

    Should you connect and disconnect to Google Play Services in each activity?

    I am writing an application which needs a connected location client in all the activities. How do the manage the state of the client? I want to call the mLocationClient.connect() only once to avoid hassle, and should be able to remove location…
    1
    2 3 4 5 6