Fundamental keyboard shortcuts to use Android Studio like an expert

- Andrés Cruz

En español
Fundamental keyboard shortcuts to use Android Studio like an expert

In this post we will see some keyboard shortcuts of all that exist that you can see in the following link:

Android Studio: Key combinations

These keyboard shortcuts indicated in this entry can be used for the most common situations that may arise when we are coding in Android Studio; in such a way that by using these shortcuts we avoid using other means such as the mouse and we can save a few seconds per operation, which in the end gives us considerable time savings (and less wear and tear on our hands!).

Control + E: Recently opened files popup

The first shortcut that we will see is one of the most general since it allows us to navigate between the files that we are editing or that are more common:

The shortcut in question is called "Recently Opened Files Popup" and that shortcut is Control + E:

control_e android studio

And using the cursors we can quickly navigate from one file to another once this small but useful window is open.

Project Quick Fix (show intent actions and quick fixes)

Many times Android Studio gives us some warning in our code, which is very useful since it allows us to improve the quality of our code, this is very common for example when we add text directly to our Java/Kotlin file, to see the warning it would be enough By clicking on the small icon that is positioned next to the line of code that has said warning, but we can also do it with a keyboard shortcut, we can press Alt + Enter:

alt_enter android studio

Control + i: Implement methods

Another very common problem is that when inheriting from other classes we probably have to override several methods that define these classes, so that Android Studio defines the basic scheme of these functions we must press Control + i.

control_i android studio

Alt + Enter: Quick fix project (show intent actions and quick fixes)

Next with the implementation of methods, when we are writing our code it is very likely that we want to create or use methods that do not yet exist within the class whose code we have selected, for this we press Control + Alt + M:

alt_enter android studio

Find/Replace

This keyboard shortcut allows us to search for code fragments or letters in the file that we are viewing at a given moment: Control + F; we also have another function that allows us to search and replace texts: Control + R.

Ctrl+Alt+M: Extract method

This shortcut allows us to place a code that we have selected and place it within the scope of a function that the same option creates (Extract method); the keyboard shortcut may not work for you on Windows, but you can also find such functionality from Refactor | Extract | Funtion or just change the keyboard shortcut to another; the keyboard shortcut is Ctrl+Alt+M:

control_alt_m android studio

Format code and Comment/uncomment with line comment

Other keyboard shortcuts that are a little better known are those that allow you to indent the selected code or all the code of a file in question; for this we press Control + Alt + L and the method to comment the selected line(s) of code(s); for this we press Control + /.

Creating/modifying our own keyboard and/or mouse shortcuts

It is likely that we have a problem with some keyboard shortcuts in our operating system, in my personal case the keyboard shortcut Control + Alt + L does not work for me, for those cases we can vary the assignment; for this we press Control + Alt + S or File | Setting and from Keymap we can customize the keyboard shortcuts:

keymap android studio

 

Andrés Cruz

Desarrollo con Laravel, Django, Flask, CodeIgniter, HTML5, CSS3, MySQL, JavaScript, Vue, Android, iOS, Flutter

Andrés Cruz en Udemy

Acepto recibir anuncios de interes sobre este Blog.