Being More Productive With Android Studio - Part One

We all know how to develop good applications by using Android Studio and we are pretty happy with what we are doing. But what if those things could be done with less effort? We all are habituated to using a mouse in our day-to-day life but sometimes knowingly or unknowingly it will increase our effort as well as development time.

Today we will see some basic shortcuts of Android Studio which will be used in day-to-day life. Most of the time we use the mouse to select a whole line or sometimes we select those things by using SHIFT + Arrow keys and then deleting that line, but in Android Studio CMD + Y(CTRL + Y) will delete the current line. Here are some Android Studio shortcuts which will help you to be more productive.

  • Delete Single Line

    Windows CTRL + Y
    macOS CMD + Y

  • Style and Formatting

    Windows CTRL + ALT + L
    macOS OPT + CMD + L

It will automatically apply your coding style and format it. However, you can edit your coding style from settings from File > Settings > Editor > Code Style(For Mac Android Studio > Preferences > Editor > Code Style)

  • Search Everywhere

    Windows double time shift
    macOS double time shift

It allows you to search any item of the source code, database, actions, elements of the user interface, etc.

  • Move to declaration

    Windows CTRL + B
    macOS CMD + B

It allows you to move to declaration of class, method, or variable.

  • Move to implementation

    Windows CTRL + ALT + B
    macOS CMD + ALT + B

Allows you to see a list of all the classes implementing the selected class. It works with method also to find where they are implemented.

  • Rename file/class

    Windows SHIFT + F6
    macOS SHIFT + FN + F6

It allows you to rename any file/class. It will rename all the copies of file/class/variable.

  • Surround with

    Windows CTRL + ALT +T
    macOS CMD + OPTION + T

It will allow you to wrap your code with some structure. It can be if statement, loop, try-catch block etc.

  • Incremental Selection/Deselection

    Windows CTRL + W / CTRL + SHIFT + W
    macOS CMD + W / CMD + SHIFT + W

It will allow you to do contextual selection -- it will select the current variable, then the statement, then the method etc.

This article was originally posted on my blog.

Up Next
    Ebook Download
    View all
    Learn
    View all