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 toSettings
-> and in IDE settings panel expandEditor
->Auto Import
->Java
and make the following changes:
changeInsert imports on paste value
to All
markAdd unambiguous imports on the fly
option as checked
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 toFile->
uncheckPower Save mode
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.
- If you want to see Line numbers permanently Go to
File
->Settings
-> left panel in IDE Settings expandEditor
-> selectAppearance
-> and on right panel checkShow line numbers
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
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 + L . 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.
or you can just turn on/off word wrap by select as below..
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.to 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 applications
I’ll add more Android Studio Tips soon..
Hope it helps somebody.
You may be also interested in
- No Update and Restart button to download latest version in Android Studio,
- Integrate BitBucket Plug in Android Studio,
- Create new Class extends a Superclass- Android Studio
- Unmappable character for encoding UTF-8 in Android Studio
- Issues after updating to Android Studio 2.0v
- Android Studio ADB wipes out logcat quickly when app crashes
One thought on “Useful Keymap Shortcuts and Settings Android Studio Tips”
Reblogged this on Dinesh Ram Kali..