Return to Video

Unconnected

  • 0:00 - 0:04
    After we connect the client in
    the onStart, it takes some time for
  • 0:04 - 0:05
    the connection to happen.
  • 0:05 - 0:08
    And when it does,
    the onConnected callback will fire.
  • 0:08 - 0:10
    This is the meat of our app.
  • 0:10 - 0:13
    We've connected to location services,
    so we should be
  • 0:13 - 0:17
    able to get the last location
    from the fused location provider.
  • 0:17 - 0:19
    And if we do get something,
    then we can read the latitude and
  • 0:19 - 0:21
    the longitude from it.
  • 0:21 - 0:23
    We convert that to a string and
  • 0:23 - 0:25
    then load it into the appropriate
    text field as you can see here.
  • 0:26 - 0:30
    Now, remember, all this will happen
    if last location is not null.
  • 0:30 - 0:33
    So, here I've just checked if
    mLastLocation is not equal to null,
  • 0:33 - 0:34
    then I will do all of this.
  • 0:34 - 0:37
    Because if it was equal to null,
    then getting the latitude and
  • 0:37 - 0:39
    getting the longitude
    might produce an error.
Title:
Unconnected
Description:

03-19 onConnected

more » « less
Video Language:
English
Team:
Udacity
Project:
UD876-1 - Google Play Services - Location & Contex
Duration:
0:41
Udacity Robot edited English subtitles for Unconnected
Udacity Robot edited English subtitles for Unconnected
Udacity Robot edited English subtitles for Unconnected
Cogi-Admin edited English subtitles for Unconnected

English subtitles

Revisions Compare revisions