简体   繁体   中英

Can we use Google's Fused Location services in offline mode?

I am planning to change my old location service to google's fused location services. My concern is to get get a googleapiclient I need to register using my api key, which requires a web call to google server.

This would restrict my apps function to internet availability. My understanding is there is no need have a internet dependency for location updates, as everything is a local affair. I can get the location from my gps and then save it in my shared preferences, then why to have an unnecessary dependency on network.

Am i missing something ? Please help.

thanks.

Yes you are missing something - you don't need any api key to register GoogleApiClient :

googleApiClient = new GoogleApiClient.Builder(getApplicationContext(), this, this).addApi(LocationServices.API).build();
googleApiClient.connect();

And yes, it does work in offline.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM