As an Android developer, At a point of time we must have hardly move to Android Studio IDE, as Google no more supporting ADT with Eclipse. As a beginner to Android Studio its hard to find and understand some of keymap shortcuts and settings in it, which are completely different from ADT Eclipse keymaps. Here are few Android Studio Tips, Keymap shortcuts and settings useful for a developer.
- To generate javadoc comments,
type /** and then press Enter key over a method generates a comment
- 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
Javaand make the following changes:
Insert imports on paste valueto All
Add unambiguous imports on the flyoption 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 to
Power Save mode
- 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
Settings-> left panel in IDE Settings expand
Appearance-> and on right panel check
Show 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
- For single line Comments/UnComments press Ctrl + /
For multi line Comments/UnComments press Ctrl + Shift + /
- 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..
- 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 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