After a long 2days effort I managed the steps to integrate Eclipse Code Formatter in Android Studio
Here I am sharing step by step procedures to integrate Eclipse Code Formatter in Android Studio:
Step 1: Go to the Plugins Section of Android Studio.
The easiest way is Click Shift twice and type Plugins. Now go to the plugins menu.
Step 2: Click on Browse Repositories
Step 3: Type Eclipse Code Formatter in the search box. Select it and Click Install button in the right section
Step 4: After successful installation you can see a blue Eclipse Icon in the top pen
Step 5: Now go to Settings >> Other Settings >> Eclipse Code formatter
Click the Browse button.
Step 6: Then select the Code Format XML file
Thats it
Any time you click the code formatting command your full code will be formatted according to the code formatter.
Code formatting shortcut:
Windows:
Ctrl + Alt + L
Linux:
Ctrl + Start + Alt + L
Mac:
Option + Command + L
In case anyone want to see how the code formatter xml looks, you can check this one.
One of the mostly used code style used by google is here.