Android Programming: The Big Nerd Ranch Guide, Third Edition
by Bill Phillips, Chris Stewart, Kristin Marsicano
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 (File → Project 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access