2018年2月24日 星期六

[Android] FusedLocationProviderClient

FusedLocationProviderClient

The 11.0.0 release of the Google Play services SDK includes a new way to accessLocationServices. The new APIs do not require your app to manually manage a connection to Google Play services through a GoogleApiClient. This reduces boilerplate and common pitfalls in your app.


  • The API calls automatically wait for the service connection to be established, which removes the need to wait for onConnected before making requests.
  • It uses the Task API which makes it easier to compose asynchronous operations.
  • The code is self-contained and could easily be moved into a shared utility class or similar.
  • You don't need to understand the underlying connection process to start coding.

它是新的存取位置的API,整合在Google Play Service中,不再因為API不同而在過去使用LocationManager上有所差異。

沒有留言:

張貼留言