Extend the previous example by building a project that can receive ongoing updates to a user's location with the requestLocationUpdates API
- [Voiceover] Getting the user's last known location…is a good start,…but many applications need more than that.…They need to know where a user is…on an on-going basis.…The location services API makes this pretty easy…and gives you a high degree of control…over how location updates are provided to your app.…And in this exercise we'll see how to do just that.…To start receiving on-going updates…there's a set of steps to follow.…First your activity must implement…the LocationListener interface,…which contains the onLocationChanged function…that you must implement.…
Next, you need to create a location request object…that contains settings which will customize how you want…to receive the updates.…Then your app should get the user's last location…using getLastLocation like we did in a previous exercise.…This will give your app a fast fix…on the user's last known location…taking advantage of any other location requests…that other apps may have made…before the updates start coming in.…When your app determines that it wants to receive updates…
Programming expert Joe Marini covers how to retrieve and work with a user's location and get continuous location updates with Location services; target and authenticate users and access their profile information with Google Sign-In; and work with the Google Drive API to store and retrieve content. Joe also shows you how to use the Google Places API to get information about places such as addresses, phone numbers, and website URLs, along with how to send messages to individual devices using Google Cloud Messaging. By the end of this course, you should be able to incorporate Google Play services into your own apps and take advantage of the various features it provides.
- Using Google Play services in your Android project
- How the Google Play services life cycle works
- Retrieving the user's location with Location services
- Working with location data
- Performing a geocoding operation
- Using Google Sign-In to access user information
- Storing information with the Google Drive API
- Working with the Google Places API
- Communicating via Google Cloud Messaging (GCM)
Skill Level Intermediate
1. Play Services Basics
2. Location Services
3. Google Sign-In
4. Google Drive
5. The Places API
6. Google Cloud Messaging
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.