Ctrl + N
/ Cmd + O
Browse / Android Studio Essentials
Android Studio Essentials
Your quick guide to mastering Android Studio with essential shortcuts, handy tips, and core usage patterns for faster development.
Essential Keyboard Shortcuts
Editing & Code Generation
|
Basic code completion. |
|
Smart code completion (filters by expected type). |
|
Show intention actions and quick-fixes. |
|
Override methods. |
|
Implement methods. |
|
Surround with (if, try/catch, etc.). |
|
Duplicate current line or selection. |
|
Delete line at caret. |
|
Reformat code. |
Build & Run
|
Run the current configuration. |
|
Debug the current configuration. |
|
Make project (compile changed files). |
|
Run context configuration (e.g., a specific test). |
|
Rerun the last run configuration. |
|
Select and run configuration. |
|
Select and debug configuration. |
Refactoring
|
Rename. |
|
Extract Method. |
|
Extract Variable. |
|
Extract Field. |
|
Extract Constant. |
|
Extract Parameter. |
|
Move. |
|
Copy. |
Tips, Tricks & Usage
Layout Editor Tips
Design + Blueprint View: Toggle between Design, Blueprint, or both views for layout construction ( |
Constraint Inference: For |
Attributes Panel: Quickly find attributes using the search bar in the Attributes panel. Star favorite attributes for quick access. |
Tools Attributes: Use the |
Layout Validation: Use the Layout Validation tool (View > Tool Windows > Layout Validation) to preview layouts on different screen sizes and configurations simultaneously. |
Convert View: Right-click a View in the Component Tree or Design surface to convert it to another type (e.g., |
Split View: Use the ‘Split’ mode (top-right icons) to see the XML code and the visual preview side-by-side. |
Debugging Techniques
Conditional Breakpoints: Right-click a breakpoint and enter a condition (Java/Kotlin expression). The debugger will only stop if the condition evaluates to true. |
Evaluate Expression: While debugging ( |
Logpoints: Instead of stopping execution, right-click a line number and choose ‘Log message to console’. Useful for tracing without pausing. |
Analyze Stack Trace: Clickable links in the Logcat or Run window allow you to jump directly to the source code line mentioned in a stack trace. |
Attach Debugger to Process: If the app is already running, use ‘Run > Attach Debugger to Android Process’ ( |
View > Tool Windows > Debug: Access breakpoints, variables, watches, and the call stack. |
Mark Object: In the Variables view, right-click an object and select ‘Mark Object’ to easily track its instances across different scopes or times. |
Layout Inspector: While debugging, use ‘Tools > Layout Inspector’ to examine the view hierarchy and attributes of your running app’s UI. |
Version Control (Git)
|
Commit changes. |
|
Update project (pull). |
|
Push commits. |
|
Show VCS operations popup. |
|
Show Version Control tool window (Log, Local Changes, etc.). |
Branch Management |
Use the branch widget in the bottom-right status bar to view, create, checkout, merge, and manage branches. |
Show History |
Right-click a file or folder -> Git -> Show History. |
Resolve Conflicts |
Use the built-in merge tool (VCS -> Git -> Resolve Conflicts) for a visual conflict resolution interface. |
Gradle & Build System
Sync Project with Gradle Files: Click the ‘Sync Now’ banner after build script changes, or use the elephant icon with a refresh arrow in the toolbar ( |
Gradle Tool Window: View > Tool Windows > Gradle. See tasks, dependencies, and run specific Gradle tasks. |
Build Variants: Use the ‘Build Variants’ tool window (View > Tool Windows > Build Variants) to switch between debug/release builds and product flavors. |
Project Structure Dialog: |
Analyze Dependencies: Right-click a module in the Gradle tool window and select ‘Analyze Dependencies’ or use the Project Structure dialog. |
Clean Project: Build > Clean Project. Removes build artifacts. |
Rebuild Project: Build > Rebuild Project. Cleans and then builds the entire project. |
Use |