Back

How to Import the Official Android Code Style

Importing the Official Android Code Style to Android Studio/IntelliJ

  1. Download AndroidStyle.xml from the Android platform_development repository.
    a. You might think you can just click the link above and Save As…, but you’re wrong. Click the link, then choose the “Raw” display option.
  2. Save it to ~/Library/Preferences/AndroidStudioBeta/codestyles.
    Hidden files and folders will need to be visible to do this. To make hidden files and folders visible, follow the steps here: http://www.mikesel.info/show-hidden-files-mac-os-x-10-7-lion/
  3. Restart Android Studio
  4. Navigate to Android Studio > Preferences
  5. Navigate to Code Style > Java
  6. From the Scheme drop-down, select the name of the imported code style
  7. Click OK

! A note on column width:

The Android code style sets the column width to 100, which is very limiting. Change this by going to Code Style > General, and changing the “Right margin (columns)” field to 200.

Thinking about a career in coding and development?

SEE OUR JOB OPENINGS

Jason Robinson
Jason Robinson