Android Programming: The Big Nerd Ranch Guide, 2nd Edition
by Bill Phillips, Chris Stewart, Brian Hardy, Kristin Marsicano
Using Google Play Services
To use Play Services, you need to create a client. That client is an instance of the GoogleApiClient class. You can find the documentation for this class (and all the other Play Services classes you will be using in these two chapters) in the Play Services reference section: http://developer.android.com/reference/gms-packages.html.
To create a client, create a GoogleApiClient.Builder and configure it. At a minimum, you want to configure the instance with the specific APIs you will be using. Then call build() to create an instance.
Inside your onCreate(Bundle), create an instance of GoogleApiClient.Builder and add the Location Services API to your instance.
Listing 31.8 Creating GoogleApiClient
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