For those who have used Eclipse before know we can supply a formatter file that can be used to format the code you write. But Android studio does not seem to provide that functionality. In this post we will see how we can use the same formatter file in Android Studio.
How to add Eclipse Code Formatter file in Android Studio
- Go to Plugins section in Studio. Shortcut is Ctrl + Shift + A and then type plugin.
- Next in the plugins window go to -> "Browse Repositories".
- Now search for "Eclipse code formatter" and install it.
- Post install you will need to restart Studio to activate the plugin. After restart go to preferences and search for formatter , you should see eclipse formatter in the search results. Select it and provide your formatter.
- That's is! You can then format your code and this formatter will be used.