Intro
As a WPF Developer, I took my talents to South Beach and quickly discovered that Miami is a tough market for native Windows Development. As a result, I decided to transition from Visual Studio to Android Studio. In doing so, it only makes sense to migrate the productivity practices that I acquired from .NET development over to Java development. In this article, I will discuss how to port over some productivity features from Visual Studio to Android Studio.
Key Bindings
Key bindings (also known as shortcut keys) are essential for software development productivity.
To leverage common Visual Studio shortcuts within Android Studio, perform the following:
General Keymap settings
- Select File | Settings | Key Bindings.
- Select “Visual Studio copy” from the “KeyMap” combobox.
Key Bindings
To change a key-binding, select an action in the “Settings” window and enter a key-combination.
Use the search box to find shortcuts to modify:
- Build Solution
- Other | Build
- Ctrl + Shift + B
- Other | Build
- Rename
- Main Menu | Refactor | Rename…
- Ctrl + R, R
- Main Menu | Refactor | Rename…
- Extract Method
- Main Menu | Refactor | Extract | Method…
- Ctrl + R, M
- Main Menu | Refactor | Extract | Method…
Snippets
Code snippets are great. They enable a user to auto-generate code from just a few characters that are typed in.
In Android Studio, Code Snippets are referred to as Live Templates.
- Select File | Settings | Live Templates
- Click Green “+” on right margin
- Set “Abbreviation” field to “prop”
- Set “Description” field to “property getter/setter”
- Set “Template Text” field to the following:
private String _stringProperty = null; public String GetstringProperty(){ return _stringProperty ; } public void SetstringProperty(String value){ _stringProperty = value; }
Code Generation
To leverage the code snippet (aka: Live Template), perform the following:
- Select File | Settings | Key Bindings
- Navigate to Main Menu | Code | Generate
- Add shortcut: Ctrl + Period
Example:
“Prop” + Ctrl+J, Space
Conclusion
As a WPF Developer, I took my talents to South Beach and quickly discovered that Miami is a tough market for native Windows Development. As a result, I decided to transition from Visual Studio to Android Studio. In doing so, it only makes sense to migrate the productivity practices that I acquired from .NET development over to Java development. In this article, I discussed how to port over some productivity features from Visual Studio to Android Studio.