2. Topic:
SHORTCUT KEYS IN ANDROID STUDIO
GROUP MEMBERS:
• ATIQ-UR-REHMAN 20-ARID-3438
• HAMMAD NAWAZ 20-ARID-3460
• NAJEEB-UR-REHMAN 20-ARID-3532
3. Introduction
Android Studio is the official integrated development
environment (IDE) for developing Android apps. It
provides a comprehensive set of tools and features to
streamline the app development process.
Android
Studio
Importance of Shortcut Keys
Using shortcut keys in Android Studio can greatly
improve your coding efficiency and productivity. By
memorizing and utilizing these shortcuts, you can
perform common tasks quickly and easily, saving
time and effort.
4. Basic Navigation
• To navigate between open files, use Ctrl + Tab.
• To navigate to a specific file, use Ctrl + Shift + N
and type the name of the file.
Moving Between Classes
Moving Between Files
• To navigate to a class, use Ctrl + N and type the name of the class.
• To navigate to a symbol (method, variable, etc.) within a class, use
Ctrl + Shift + Alt + N and type the name of the symbol.
Moving Between Methods
• To navigate to a method, use Ctrl + F12 and type the name of the method.
• To navigate to the declaration of a method, use Ctrl + B.
• To navigate back to the previous location, use Ctrl + Alt + Left.
5. Code Editing
• Copy: Ctrl + C
• Paste: Ctrl + V
• Delete the current line: Ctrl + Y
• Duplicate the current line: Ctrl + D
General Editing Commenting Code
• Comment: Ctrl + /
• Uncomment: Ctrl + Shift + /
Code completion
• Control + Space: Displays basic
suggestions for variables, types,
methods, expressions,
• Control + Shift+ Space: Displays
relevant options based on the context.
Search
• Shift + F3: Find Next/Previous
• Ctrl + Shift + B: Find Implementations
• Ctrl + F7: Find Usages/Find Usages in File
6. Refactoring
• Use the shortcut Shift + F6 to
quickly rename variables
throughout your codebase.
• Use the shortcut Ctrl + Alt + M to
extract a block of code into a
separate method.
Renaming Variables Extracting Methods
Optimizing Imports
• Use the shortcut Ctrl + Alt + O to
remove unused imports and organize
the remaining ones.
7. Debugging
• Set a breakpoint by clicking on the left margin of a
line of code.
• Toggle a breakpoint by pressing Ctrl+F8.
• Remove a breakpoint by clicking on the
breakpoint icon in the left margin of the code
editor.
• Step over a line of code by pressing F8
• Step into a method by pressing F7
• Step out of a method by pressing Shift+F8
Breakpoints Stepping Through Code
Inspecting Variables
• View the value of a variable by hovering over it
with the mouse.
• Add a variable to the Watches window by right-
clicking on it and selecting 'Add to Watches'.
• Evaluate an expression by typing it into the
'Evaluate Expression' window.
8. Build and Run
• Ctrl + F9 - Compile the current
file
• Shift + F9 - Compile and run the
current file
• Shift + F10 - Run the app
• Shift + F9 - Debug the app
• Ctrl + Shift + F10 - Run all
tests in the current file
• Ctrl + Shift + F9 - Debug all
tests in the current file
Compiling Code
Deploying the App
Running Tests
9. Version Control
• Ctrl + T - Update project from the repository.
• Ctrl + Shift + T - Update project from the
repository and rebase local changes.
Updating from Repository
• Ctrl + K - Commit changes to the
repository.
• Ctrl + Shift + K - Push commits to the
remote repository.
Committing Changes Resolving Conflicts
• Ctrl + Alt + Shift + R - Resolve
conflicts in the current file.
• Ctrl + Alt + Shift + G - Resolve
conflicts in the entire project.
10. Other Shortcuts
• Ctrl + F: Find
• Ctrl + R: Replace
• Ctrl + Shift + F: Find in Path
• Ctrl + Shift + R: Replace in Path
Navigating to Specific Lines
• Ctrl + G: Go to Line
• Ctrl + E: Recent Files
• Ctrl + Shift + E: Recent Locations
• Ctrl + B: Go to Declaration/Definition
• Ctrl + Alt + O: Optimize Imports
• Ctrl + Alt + L: Reformat Code
• Ctrl + Shift + Alt + L: Reformat File
Organizing Imports
Searching for Code