From Visual Studio to Android Studio

Android

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

  1. Select File | Settings | Key Bindings.
  2. 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
      • Rename
        • Main Menu | Refactor | Rename…
          • Ctrl + R, R
      • Extract Method
        • Main Menu | Refactor | Extract | Method…
          • Ctrl + R, M

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.

  1. Select File | Settings | Live Templates
  2. Click Green “+” on right margin
  3. Set “Abbreviation” field to “prop”
  4. Set “Description” field to “property getter/setter”
  5. 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:

    1. Select File | Settings | Key Bindings
    2. Navigate to Main Menu | Code | Generate
    3. 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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: