Got a YouTube account?

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

English feliratok

← 08-20 Finish the SyncAdapter

08-20 Finish the SyncAdapter

Beágyazókód kérése
6 Languages

Showing Revision 12 created 05/07/2015 by Udacity Robot.

  1. All right, you're done.
  2. Let's look at the solution.
  3. Okay, we'll begin by adding a log tag
    in to our AbstractThreadedSyncAdapter.
  4. Since this stuff runs in the background,
    it's helpful to have some logging.
  5. Since we ultimately want the syncAdapter
    to run in an unattended mode,
  6. we pull the location query
    from our Utility class, and
  7. then we paste in the code from
    our existing sunshine service.
  8. We'll have to patch a few things up.
  9. We'll have to call get contexts
    to get the current context.
  10. For example, we copy over
    the getWeatherDataFromJson function
  11. as well as the addLocation function.
  12. Finally we fix updateWeather
    to use our syncAdapter.