views:

664

answers:

4

Android Code Style Guide defines "Android Code Style Rules".
To conform to these rules one have to change quite a number of settings of the Java Code Formatter (Window->Preferences->Java->Code Style->Formatter) default profile (in Eclipse IDE).

Did anyone manage to configure the formatter to follow the "Android Code Style Rules" already?
If yes, please export the Formatter profile and publish to be used by community.

PS: I've tried to do this myself but I've found that there are too many formatter options available, and most of them are not mentioned in the Code Style Guide :-(

+1  A: 

I think personal or team preferences vary to much to globally enforce a coding style. So every body should deploy his project specific coding style.

Soulreaper
I agree, but it's much easier to start from the "globally enforced code style rules" and change them only in those areas that are really important to the person or team,comparing to starting from "as is" and then trying to figure out how far this state is from "globally inforced code style rules"?!
yvolk
+7  A: 

There are pre-made formatter rules available from the platform/development.git repository. So you can simply import android-formatting.xml and android.importorder as mentioned here.

kroimon
Thank you, kroimon, very much!This is exactly what I was dreaming of :-) - these are "live" documents that continue improving as the Android ecosystem matures.
yvolk
+1  A: 

On a related note, here's how developers around Google keep their various Eclipse instances all in agreement: Workspace Mechanic for Eclipse

Drew Dara-Abrams
A: 

The link in kroimon's answer to android formatter rules is broken. Here is the correct one.

omermuhammed