# Debugging Lab This will take 90 minutes. The goal of this exercise is to help you learn how to improve your debugging skills to help troubleshoot issues. You'll have a chance to become more familiar with reading stack traces, setting breakpoints and stepping through code, and understanding how to resolve issues on your own. Make sure to review these videos and guides before getting started. Try to use some of the idea and techniques suggested in these documents. Re-read it several times and make sure you take your time trying to solve each one. You will learn much effectively by trying to understand the issue rather than trial and error approaches. * [Debugging Intro](https://youtu.be/UH7bGwf7tM0) (1:51) * [How to Approach Issues](https://youtu.be/Q8CyjevLqcQ) (3:14) * [Intro to Toasts and Logcat](https://youtu.be/Jc0K7mlpt7U) (3:52) * [Using Logcat](https://youtu.be/1ehuPnGlH8I) (2:11) * [Setting Breakpoints](https://youtu.be/cOHF0gQq9Io) (3:42) Guides: * [When Things go Wrong](https://hackmd.io/s/rkO_BigjW) * [How To Solve Technical Issues](https://hackmd.io/s/r1bhe4La7) ### Project Setup 1. Open an existing Android Studio project 2. Download the starter project: https://codeload.github.com/codepath/android-debugging-challenges/zip/master 3. Launch the app in Android Studio to make sure the application launches properly ### Challenge This app contains a number of bugs/issues which you will be responsible for finding, diagnosing, and fixing. The challenge is split into four different sections/milestones. Each of the four buttons on the main screen of the application comprises of one milestone. ### Milestone 1 - What Day Is It The first issue we will address can be found by clicking on the button with text `WHAT DAY IS IT?`. **Expected behavior**: A new screen should appear which displays the current day of the month: ![expected behavior milestone 1](https://i.imgur.com/ABKDrT4l.png) **Actual behavior**: The application crashes. ### Milestone 2 - Background Changer **Expected behavior**: Clicking the **Go** button should change the background image. ![expected behavior milestone 2](https://i.imgur.com/OxpHv6o.gif) ### Milestone 3 -- Toolbar! **Expected behavior**: The screen and toolbar should render. **Actual behavior**: The application crashes. **Hint**: There are two different implementations of the [Action Bar](https://guides.codepath.org/android/Defining-The-ActionBar). ### Milestone 4 -- View movies **Expected behavior**: The screen should display a list of the latest box office movies from Rotten Tomatoes. Each should display a name, rating, and photo. ![expected behavior milestone 3](https://i.imgur.com/4P1VpRa.png?1) There are several issues needed to be fix in order for the app to displays the latest box office movies. Work through the various issues until you reach the expected behavior. ### References * [Guide to When Things Go Wrong in Android Apps](https://hackmd.io/s/rkO_BigjW) * [Debugging App Crashes Guide](http://guides.codepath.org/android/Debugging-Exceptions-within-your-App)