Android's most accurate Location API

前端 未结 5 1887
死守一世寂寞
死守一世寂寞 2020-12-14 09:44

In order to work, my app requires a location API. I intend use the Mapbox platform to customize its design (since Google Maps does not provide this level of customization, a

5条回答
  •  死守一世寂寞
    2020-12-14 09:53

    In android also there are three types of location :

    1. GPS_PROVIDER
    2. NETWORK_PROVIDER
    3. PASSIVE_PROVIDER

    So, as per my coding experience I came to know that if you use :

    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 10, new MyLocationListener());
    

    you will get precision upto 14+ decimal places.

    But if you use fusion of them like this :

    LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, my_google_listener);
    

    you will get precision upto 6 to 7 decimal places. try it !!! reference

    But note few things here that, GPS Provider takes time to fetch location while Google Location is much faster as it gets data from API call to its google server database.

    GPS works offline while google provider gets the location via mobile or wifi data.

提交回复
热议问题