…Android Studio includes tools that let you analyze your Java code.…It looks for errors or poor practices in…coding, and offers recommendations for improving the code.…I'll demonstrate this in my list activity class.…Notice that I have a declaration of a variable here called R.…And I'm not doing anything with that variable.…I'll show you how you can find these sorts of issues.…I'll go the menu and choose Analyze, Inspect Code.…In the Specify Inspection Scope Dialogue, I'll…select Custom Scope and Only My Open Files.…
And then click Okay.…It takes just a moment to inspect the code.…Now if you inspect an entire project, it'll take a bit longer.…The Inspection Results window opens at the bottom of the screen.…I'll open the branch labelled probable bugs.…And here's that issue: variable R is never used.…I can then double-click And that'll take me to that code.…Now I see the little lightbulb icon that…tells me that there's a quick fix available.…I'll press Alt+Enter and it asks me if I want to remove the variable R.…
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.