Top 33 Android Studio Tips & Tricks which helps you to reach your destination earlier !
As an Android Developer we use a number of IDE for writing the code for the Application. For example, Android Studio, Eclipse But the most popular and recommended one among these IDEs is the Android Studio. Nowadays, every Android Developer uses Android Studio to write codes for their Application because Android Studio provides us a lot of functionalities and features, that make the speed of writing codes fast. So in this article, we are going to discuss the top 33 tricks, shortcuts of Android Studio that will help you in improving your coding speed.
If You are new to Android Studio then please read my Article on how to make our first Android App from Scratch Beginner’s Guide to Android App Development in 2024. This will help you in learning the basics of Android App Development.
All Tips at One Place
Part 1 – Core IDE Shortcuts
1. Alt + 0…9 – Open Any Tool window : In Android Studio , there are around 10+ tool windows which all are located in Tool Window Bar. There is a sequence to open these Tabs like-
a.) Alt+1 > to Open Project Window
b.) Alt+2 > to Open Bookmark Window and So on…
2. Shift + Esc – To Close Any Active Window : If you have opened any window and you are working in that window then use this shortcut to close that window.
3. F12 – Open or Close Last Opened Window : You can close or open the last window you worked on with this shortcut.
4. Ctrl + Shift + F12 – Close or Open All Active Windows at Once : If you have opened a couple of windows and you feel a little cluttered the IDE then use this trick to close all the windows at once or open them all again in no time.
Part 2 – Navigation Shortcuts
5. Start Typing in Project Window: If you want to search for any file from all the visible files then start typing the name of file which you want to search.
6. Alt + </> – To Switch b/w Active Editor Tabs : If you have opened multiple Editor tabs then with this shortcut you can move to left or right b/w these files.
7. Shift + Shift – Search Anything : This is most powerful feature of Android Studio in which you can search anything in your project files or can access or modify IDE settings in one Dialog.
Part 2 – Code Editor Shortcuts
8. Alt + up/down arrow – To Jumps from method to method : This trick will save a lot of your time to scrolling from top to bottom in a long code file. This shortcut will take you from method declaration to next method declaration.
9. Ctrl + left/right : To move move cursor (word by word) : Normally when use arrow to move cursor then it only move letter by letter which is too slow . If you use this trick then cursor will move word wise which is much faster then conventional way.
10. Shift + left/right: To select Code(letter wise) : This way you will be able to select code letter by letter without using mouse.
11. Ctrl + Shift + left/right: To select Code(Word wise) : This time you can select code word wise.
12. Shift + up/down – To select Multiple line of code : If you want to select multiple lines of code at once without using mouse then use this trick in which code will be selected from the cursor position to the line till you select. This trick will only select code either below the cursor or before the cursor. To select from both side use the next shortcut.
13. Ctrl + W – To select Multiple line code uniformly : This shortcut will help you select the code on both side of cursor uniformly or simply say it will expand you selection of code in all direction .
14. Ctrl + Shift + up/down – To move a code up or down (within function scope) : This shortcut will help to move selected code to up or down line by line only within the scope of function means that you can move that code only within the method itself not outside the function opening or closing brackets.
15. Shift + Alt + up/down – To move code anywhere in a class : This way you can move the selected code to anywhere in Kotlin class.
16. Ctrl + D – To duplicate code : This is mostly used trick to duplicate a code line below it. You can make any duplicate copy of that code but it not like copying code because copy code will fill your clipboard but duplicating code will just produce new copy of that without filling space in clipboard.
17. Ctrl + Y – To Delete Code : This will simply delete the selected code or the complete line of code in which cursor is there. You can simply undo your actions by Ctrl + Z .
18. Shift + F6 – To Rename Variable/class/functions : If you want to rename a variable or class or any method name throughout whole project then this trick is for you. It will simply rename that variable everywhere in the project.
19. Alt + J – To Select Similar Occurrences : This shortcut will select the similar variable or keyword as of your cursor on. After selecting these all together you can modify or Rename them at once. It is similar to Rename shortcut but there you can’t select which one to update and which one to leave.
20. Ctrl + B – To Go to Function Declaration : When you want to go to method declaration then use this shortcut. It will help you to travel b/w function declaration location or from there to method calling location.
21. Ctrl + Q – To show Documentation : If you select any Datatype , function or class then use this shortcut it will show the complete information or say Official Android Documentation related to that.
22. Ctrl + P –
To show Function Parameters :
If you are calling a function but don’t know what are its parameter then this trick will instantly give you the hint.
23. Ctrl + Space or Ctrl + Shift + Space –
To Give Smart Code Completion :
When you are calling a function then you need to pass the function parameters to it , So this trick will show the smart possible values that you can pass to your function as parameters.
24. Ctrl + Shift + Backspace – To Go to Last Edit Location : When you are coding then you may need to go from class to class and then start typing new code there but what will you do if you need to go to last code edit location at instantly. So this trick is for you.
25. Ctrl + Alt + N – To Inline Code : There might be times when your code stretched to multiple lines causing the code to take multiple lines. So if you want to make them into one line then use this shortcut.
26. Ctrl + / – Single line Comment : It will comment the whole line on which there is cursor. This code will produce Single Line Comment(One of the Two types of Comment in Kotlin Language).
27. Ctrl + Shift + / –
Multiline Comment :
This shortcut will convert the selected code to Multiline Comment .
28. Ctrl + Shift + V –
Open Clipboard :
This will open the clipboard of Android Studio where you can access all the copied code in one place and select multiple from that and use it at once.
29. Ctrl + Shift + Alt + T –
Open Refactor Dialog :
This will show a dialog in which there a lot of useful features available like Rename , Shortcuts to Extract Variables or methods etc.
30. Ctrl +Alt + M – To Extract Function/Method : This shortcut will convert a selected code to a function and you can give any name to that function.
31. Ctrl + Alt + T – Surround with Statements : This will show a list of statements like if/else , try/catch ,for loop etc. which will be wrapped around your code. Like if you want to add your code to try/catch block then it simply do it for your without typing any extra line of code.
32. Alt + Tab – Switch b/w Recent Programs : This shortcut is your machine specific which mean this is applicable to window’s PC . This will help you to switch b/w recent programs like switching back and forth b/w Android Studio and You tube when you are following a tutorial.
33. Ctrl + Shift + Alt + L – Reformat Code : When we write code, we normally don’t care about the formatting our code by ourself. But you know a nice formatted code will improve the readability of your code. So this trick will do that for you. Next time don’t forgot to reformat your code when you are done writing it.
That is all for this Article guys, to follow along please watch my whole video on these shortcuts of Android Studio.
Hi, this is a comment.
To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
Commenter avatars come from Gravatar.