Location updates not working indoors as claimed by Fusion Location Provider APIs

前端 未结 4 1571
失恋的感觉
失恋的感觉 2021-02-02 02:20

Issue:

Location updates not working indoors as claimed by Fusion Location Provider APIs.

What happened:

  1. I tried
相关标签:
4条回答
  • 2021-02-02 02:24

    After long testing and debugging on HTC One X (4.1.1), I decided to try same test cases on any other phone model. Luckily my app worked indoors too when testing with my friend's Samsung S3 (4.1.1). At same time and location, when I tested with my HTC One X, I do not get location indoors. Both phones are set with same settings (WiFi/GPS/Mobile network all enabled).

    To confirm this is an issue with specific device, I performed many tests inside the building at different corners using my app and I see the same issue on my HTC at all indoor locations (but at same locations S3 gets the indoor location).

    0 讨论(0)
  • 2021-02-02 02:33

    Are you certain that you're not disconnecting the client? Once you disconnect the LocationClient, the current location update request disappears.

    The code snippets by themselves are not a complete app. The sample app, however, is a complete working app. The purpose of the snippets is to show you the key steps, from which you can cut and paste. The sample app provides more material.

    0 讨论(0)
  • 2021-02-02 02:37

    Based on your snippets your code looks fine to me for receiving indoor locations.

    Try doing a dump while your app is requesting locations and you are indoors (expecting to receive locations but not): adb shell dumpsys activity service com.google.android.location.internal.GoogleLocationManagerService

    Can you post the output here?

    Can you double check that Settings->WiFi is enabled, and that Settings->Location access->Wi-Fi & mobile network location is enabled (both are required for indoor location).

    Does your phone have a sim card? This would allow cell tower derived locations when wifi isn't available.

    Finally you said that Google Maps gives you a location indoors in the same building. What is the approximate size of the accuracy circle (i.e. is it closer to 20 meters or 100 meters)?

    0 讨论(0)
  • 2021-02-02 02:46

    tinku! I've got the same issue with my Galaxy Nexus and Fusion Location Provider APIs.
    My decision is setting priority for LocationRequest object to LocationRequest.PRIORITY_LOW_POWER

     mLocationRequest = LocationRequest.create();
    
     mLocationRequest.setPriority(LocationRequest.PRIORITY_LOW_POWER);
    
     mLocationRequest.setInterval(UPDATE_INTERVAL);
     mLocationRequest.setFastestInterval(FASTEST_INTERVAL);
     mLocationClient = new LocationClient(this, this, this);
    


    For me it works fine indoors (low accuracy) and outdoors (high accuracy). Hope it will help you.

    0 讨论(0)
提交回复
热议问题