Learn how to use log statements and the debugger to understand how this complex app works.
This exercise is a variant of Google's "Sunshine" app in the "Developing Android Apps" e-course from Udacity.
- Clone repository.
- Create a new branch off master and name the branch according to the form {name}/debugging2 (e.g. mgroves/debugging2).
-
Run the app.
-
Look in the Android Monitor for the URL of the network request that is being made.
-
What does the weather data look like that is coming from this network request? Add a log statement at the appropriate place in the code and re-run the app. Think about what logging level this should use.
-
Now, let the app run for at least a minute.
-
Why is the network request logged multiple times? Try adding a breakpoint to see where this is getting called from.
-
Show your work by writing comments as you trace the execution flow through the app. This is hard, so don't feel discouraged if you don't find it.
-
When you discover why network requests are happening multiple times, change the code so this only happens once.
-
Create a pull request against master with your solution.