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
    4
    votes
    1 answer

    LocationClient - Mock Locations

    I'm using the LocationClient which works good. Now I'm trying to create mock locations (setMockMode(true) + setMockLocation(mockLoc). But onLocationChanged of my LocationListener isn't called. What can be the problem? I followed this:…
    4
    votes
    2 answers

    Use current location in many android activities

    I am making an app that has to use user's current location in many activities. I don't really want to implement a location client in every activity. What's the best way to use the current location in my app? Probably a background service? And if so,…
    4
    votes
    2 answers

    Continuous location updates in background

    i am developing a application which will send location updates continuously from a background service. i tried following code. public class LocationService extends Service implements…
    4
    votes
    1 answer

    When should I disconnect from Google Play Services in my Android app?

    My app uses the Location Client in order to retrieve current location and also route to points placed by user on a map. I am new to the google play services and am wondering as far as best practices go when should I disconnect my LocationClient if…
    dwp4ge
    • 1,963
    • 22
    • 27
    4
    votes
    1 answer

    Android Fused Location API - how to use PRIORITY_BALANCED_POWER_ACCURACY and PRIORITY_HIGH_ACCURACY in one application?

    Android Fused Location API - how to use PRIORITY_BALANCED_POWER_ACCURACY and PRIORITY_HIGH_ACCURACY in one application? Hi, I am developing an applicaiton which need to send periodic location updates. I have used Fused Location API with a locaiton…
    3
    votes
    1 answer

    Android LocationClient onDisconnect doesn't get called

    From the GooglePlayServicesClient.ConnectionCallbacks documentation onDisconnected should get called when the LocationClient is disconnected. From my testing I noticed it never gets called if I disconnect the LocationClient myself. Here is the most…
    Moemars
    • 4,692
    • 3
    • 27
    • 30
    3
    votes
    1 answer

    DeadObjectException in GMS::LocationClient (Android)

    On Android we have a class that wraps a LocationClient object from GMS (Google Mobile Services). (Note that LocationClient implements com.google.android.gms.common.GooglePlayServicesClient). Unfortunately the LocationClient object has a habit of…
    boboon
    • 41
    • 1
    • 5
    3
    votes
    0 answers

    LocationClient Accuracy incorrect

    I implemented the new LocationClient into my app, but doing a test run I noticed the readings are incorrect. I was driving outside without GPS. WLAN on. Thus location accuracy can only be what used to be NETWORK. I set the LocationClient to…
    Gunnar Bernstein
    • 6,074
    • 2
    • 45
    • 67
    3
    votes
    3 answers

    locationclient.getlastlocation() always returns null on emulator

    I am new into Android world. I was just referring this tutorial from Google: http://developer.android.com/training/location/retrieve-current.html Program compiles fine and launches application on emulator, but when I try to find…
    Pratik
    • 952
    • 2
    • 16
    • 31
    3
    votes
    1 answer

    How can I get notified when Google Play Services can not get a location fix?

    I have an android application that needs to ascertain its current location (Using Google Play Services LocationClient) and then send that location back to a server. This needs to happen in the background at regular intervals e.g. Every 5…
    Steve Weet
    • 28,126
    • 11
    • 70
    • 86
    2
    votes
    2 answers

    How can i downgrade Google Play Services Library in Android SDK?

    The latest update to the Google Play Services Library of the Android SDK removed the LocationClient class from it. How can i downgrade to the previous version so i won't have to rewrite the code to retrieve a client's location? I do intend to…
    Hbibna
    • 568
    • 7
    • 11
    2
    votes
    1 answer

    locations are received before locationRequest.setFastestInterval

    I have set the Interval and Fastest Interval as, locationRequest.setInterval(30 * 60 * 1000); //30 minutes locationRequest.setFastestInterval(30 *60 * 1000); //30 minutes But I sometimes receive the location updates before 30 minutes and the…
    Azhar Bandri
    • 892
    • 1
    • 14
    • 27
    2
    votes
    0 answers

    setExpirationDuration in LocationClient callback function?

    How to understand and show message if requestLocationUpdates is expired (setExpirationDuration ) and did not get any location?
    Anton Nikitin
    • 197
    • 1
    • 10
    2
    votes
    1 answer

    LocationClient.getLastLocation() returns Null although connected

    iam trying to receive my current location through the LocationClient but for some reason it returns null. I dont NOT want to use GPS therefore i have dummied out the fine location access permission in my Manifest. Manifest:
    user3425561
    • 79
    • 1
    • 10
    2
    votes
    1 answer

    Fused location - locationclient not connected inside onConnected method

    I'm trying to use Fused Location API in order to get location in my app. what I do is calling a LocationClient.connect() and then I look for location inside the onConnected method. What I unexpectedly get is this: IllegalStateException: Not…