O'Reilly logo

Android Programming: The Big Nerd Ranch Guide, Third Edition by Kristin Marsicano, Chris Stewart, Bill Phillips

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting Up Google Play Services

To get your location using the Fused Location Provider, you need to use Google Play Services. To get those up and running, you will need to add a few standard bits of boilerplate to your app.

First, you need to add the Google Play Services library dependency. The services themselves live in the Play Store app, but the Play Services library contains all the code to interface with them.

Open up your app module’s settings (FileProject Structure). Navigate to its dependencies and add a library dependency. Type in the following dependency name: com.google.android.gms:play-services-location:10.0.1. (As of this writing, this dependency will not show up in search results, so type carefully.) This is the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required