English subtitles

← Workflow Solution

Get Embed Code
4 Languages

Showing Revision 7 created 05/24/2016 by Udacity Robot.

  1. So the correct answers are here.
  2. First of all, you'll create a Google API
    client that uses your desired API.
  3. In the example I showed earlier,
  4. I was using the location services
    API with a Google API client.
  5. With others, you may be doing login,
    you may be doing maps, you may be
  6. doing other things, but you'll still
    be using a GoogleApiClient for that.
  7. You'll next extend your activity
    with the ConnectionCallbacks.
  8. These are the heart of
    the asynchronous programming model,
  9. where the services can call you back
    whenever something important happens.
  10. You'll also need to extend your activity
    with the OnConnectionFailedListener.
  11. In case the connection fails, so
    that you can handle it gracefully.
  12. And then, finally, after connecting
    the GoogleApiClient that you
  13. created earlier on, you wait for
    the onConnected callback.
  14. Once you get the onConnected callback,
  15. you know that your ApiClient
    is connected to the services.
  16. And you're able to make
    the calls on those services.
  17. And then once you've done that,
  18. you can follow the requirements
    of your specific API.
  19. Like for example, as you saw earlier on,
    I was doing location work, so
  20. I also had an on location
    changed method, that was firing
  21. whenever the location changed,
    as a result of the location request.
  22. You'll see all of this in much more
    detail in the location services module,
  23. as well as all of the other modules.
  24. This sequence will be used in every
    app that you build and you'll
  25. want to be sure that you know it as you
    move through the rest of the class.
  26. Since this sequence is so important,
    take some time to think of a good way to
  27. remember these steps and then maybe
    go post in the forum about it.
  28. Also take some time to read
    what other people have said.
  29. You might find a methodology
    that works for you.