Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Finish the SyncAdapter - Developing Android Apps

Get Embed Code
10 Languages

Showing Revision 18 created 05/25/2016 by Udacity Robot.

  1. All right, here's a big one.
  2. Finish the SynchAdapter,
    making it fetch the weather
  3. and store it in the database.
  4. Alter the updateWeather function
  5. within the ForecastFragment
    to start a sync with the SyncAdapter.
  6. Some hints here.
    Pull the code from
  7. on handle intent into our SyncAdapter.
  8. On handle intent is inside
    of our Sunshine service.
  9. The good news is that abstract threaded
  10. sync adapter provides a background thread
  11. to run the server fetch on,
    just like intent service does.
  12. Also, just fetch the location
  13. query from our utility class.
  14. Eventually, we want to run syncs
    like this without
  15. any involvement of the user.
  16. Finally, make the sync adaptor run
    when we call Update Weather.