Android Studio

Useful Keymap Shortcuts and Settings Android Studio Tips

Android Studio Tips

Hi Guys, Here are few Android Studio Tips, Keymap shortcuts and settings useful for a developer.

Javadoc comments

  • To generate javadoc comments,
    type /** and then press Enter key over a method generates a comment

Organize imports

  • To organize imports, Ctrl + Alt+ O and at times it may not work as expected.
    So, Go to Settings-> and in IDE  settings panel expand Editor -> Auto Import -> Java and make the following changes:
    change Insert imports on paste value to All
    mark Add unambiguous imports on the fly option as checked

Android Studio Tips 1

 Power save mode

  • If you are not seeing red underline for code errors as  highlighted code, you may be turn  on Power save mode
    So, Go to File-> uncheck Power Save mode

as_settings1

Line numbers

  • If you want to see Line numbers in a code file you can turn on/off by right clicking on workspace left border and Check Show Line Numbers. This applies only for the active file. And these Line numbers will disappears if you close file.

as_settings3

  •  If you want to see Line numbers permanently Go to File-> Settings-> left panel in IDE Settings expand Editor-> select Appearance-> and on right panel check Show line numbers

Android Studio Tips 2

Quick definition lookup

  • To open a quick definition lookup, i.e. If you want to see the full method implementation when mouse hover on a method call statement, press Ctrl+Shift+I. below is sample screenshot

Android Studio Tips 4

Comments/UnComments

  • For single line Comments/UnComments press Ctrl + /
    For multi line Comments/UnComments press Ctrl + Shift + /

Indentation

  • To format code with correct indentation press Ctrl + Alt + . This keymap works for Java, XML design files too.

Find All Usage

  • To Find(or Search) Usage of a variable or class or method in whole project, place cursor on that search variable or method or class, and press Alt +F7. And you can see all occurrences of the searched item, in a tab opened at the bottom  of editor.

Use soft wraps

  • To apply word wrap go to Settings-> in IDE Settings select Editor ->and in right panel check Use soft wraps in editor.

Android Studio Tips 5

or you can just turn on/off word wrap by select as below..

as_wrap

Lower/Upper case

    • To apply Lower/Upper case for a text in WorkSpace editor, Select a text which need to Uppercase, and Press Ctrl+Shift+U, the text will changed to Uppercase, If you press again same keys, text will changed to Lower case.

Enable ADB Integration

    • If your appliation not showing in Debuggable Applications, you may not see your app log cat properly.app_not_recognizedto see your application in Debuggable applications drop down, you should Enable ADB Integration. Goto Tools-> Android-> Click Enable ADB Integration. You will see your app list in debuggable applicationstools_44
    •  

I’ll add more Android Studio Tips soon..

Hope it helps somebody.

You may be also interested in

One thought on “Useful Keymap Shortcuts and Settings Android Studio Tips

Leave a Reply

Your email address will not be published.