Using breakpoints and stepping through code lets you examine your program and complete thorough debugging. Android Studio comes complete with powerful debugging tools. Learn how to implement breakpoints, watch variables and go through your code step-by-step to find problems and fix them quickly. Discover shortcuts to get started on this efficient Android Studio debugger and begin to test and repair your programs quickly and efficiently.
…IntelliJ IDEA has a powerful set of Java debugging…tools, and Android Studio inherits all of those tools.…I'll show you how to use break points, watch variables, and step through code.…You can follow along in any Android app.…First of all I'm going to go to my current activities layout file.…I'll use the related file link and choose activity.mainxml.…This layout has a button.…And I'm going to add a method that's…called when the user clicks or touches the button.…
I'll use the click handler attribute of the Button element to do this.…I'll make a new line and type click, and then choose the onclick attribute.…Now I can name the method that's going to be called anything I want.…I'll name it clickHandler.…Notice that the little light bulb icon appears,…that tells me there's a quick fix available.…And I'll press Alt+Enter, and choose create clickHandler in list activity.…And that automatically creates the right signature…for the method that I want to call.…Now, I'm going to add a for loop that I can step through as I debug my app.…
Note: This course was revised on 8/20/2014 to reflect changes in the .0.8.4 beta version of Android Studio.
- Exploring Android Studio and IntelliJ IDEA
- Installing Android Studio
- Creating projects with Android Studio
- Navigating the user interface
- Designing activity layouts
- Analyzing and refactoring code
- Debugging and packaging apps
Skill Level Beginner
Q: This course was updated on 8/20/2014. What changed?
A: We revised this course to reflect changes to the Android Studio beta, released at the 2014 Google I/O conference. This update was recorded with Android Studio .0.8.4, which contains a new project wizard and updates to the Gradle build system. For more information about the changes in this course, check out the "What's new in this update" movie.