Using Android Studio to increase productivity


Android Studio has been released officially. A couple of bug fix releases have already been rolled out since the first stable release. You can download the latest stable version from here.

Android Studio

There are 3 more release channels along with Stable channel. Namely,

  1. Canary channel: rough edges build
  2. Dev channel: slightly more stable than Canary
  3. Beta channel: Beta version
  4. Stable channel: Stable release

If you would like to test out Canary builds or Dev builds, then you can look at this page.

After running Android Studio (AS) you can set the default channel from which it will look for the next updates.

Set default update channel

Fire up AS.

  1. On Mac, go to Preference (cmd + ,) and on Windows go to Settings
  2. look for Updates from left pane
  3. Select channel from the drop down list on right pane
  4. Hit Apply -> OK

Dracula theme

Currently there are two themes in AS. I would suggest to use Dracula theme. It’s background is black and the syntax highlighting color combination is more soothing to look at. If you are a full-time developer then you might work on AS for long hours and Dracula theme would be a preferable choice.

  1. On Mac, go to Preference (cmd + ,) and on Windows go to Settings
  2. look for Appearance from left pane
  3. Select themes from the drop down list on right pane
  4. Hit Apply -> OK

Auto import

AS can auto import classes for you. On ambiguous occassion it would provide a dialog box for you to choose, otherwise it will done it automatically. To turn on this feature,

  1. On Mac, go to Preference (cmd + ,) and on Windows go to Settings
  2. look for Editor from left pane then Auto Import
  3. Check: Optimize imports on the fly
  4. Check: Add unambiguous imports on the fly
  5. Hit Apply -> OK

Useful shortcuts

Duplicates:
Place cursor on a code line. Hit Cmd + d. (The line will be duplicated on next line)

Go to a class:
Hit Cmd + n. Type out the name of a class and hit enter.

Go to a file:
Hit Cmd + Shift + n. Type out the name of a file and hit enter.

Rename:
place cursor on the “thing” you would like to rename. Hit Shift + F6

Quick fix:
Alt + Enter.
This shortcut also heavily used to extract hardcoded string resources from java to xml

Plugins

Following plugins can be handy for Android developers.

  • Genymotion
  • .gitignore Support

Genymotion

Genymotion is a third-party emulator made by Genymobile. It a faster and more responsive than official Android emulator. Get Genymotion from here.

.gitignore Support

Nice plugins to edit .gitingore file. Details can be found here.

Invalidated Caches / Restart

Often times when you add a jar file or library and also added the necessary code on build.gradle file and then sync the gradle file but still the jar is not added to the project then you might need this option. Go to File -> Invalidated Caches / Restart and Hit on “Invalidate and Restart” button.

Code completion

  1. On Mac, go to Preference (cmd + ,) and on Windows go to Settings
  2. look for “Editor” from left pane and then “Code Completion”
  3. Check: Parameter Info -> Autopopup in (ms): 1000 (This will display the parameter info of a method in 1 sec.
  4. Hit Apply -> OK

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