[ACCEPTED]-How to import .XML code style into Android Studio-android-studio

Accepted answer
Score: 31

Copy intellij-java-google-style.xml into the directory $HOME/Library/Preferences/IdeaIC14/codestyles/.

0

Score: 13

I am using Android Studio 1.2 on Ubuntu 13 12.04 and in my case I have an .AndroidStudio1.2 12 folder in my home directory. In this folder 11 there is a config folder. What I did was 10 the following:

  1. I created a new folder called codestyles in the config folder.
  2. copied my style xml (in my case named AndroidStyle.xml) into the codestyles folder (.AndroidStudio1.2/config/codestyles/AndroidStyle.xml)
  3. Went into File>Settings>Editor>Code Style
  4. Chose the AndroidStyle among the listed Schemas.

NOTE: Android Studio does 9 not give you an option to import the xml 8 file. And before you add the file to the 7 codestyles folder there is NO indication 6 that you can change the Schema to your own 5 in any way. But after you have added the 4 file the added schema will be shown among 3 the other schemas.

NOTE 2: In other Operating 2 systems this folder is located elsewhere. For 1 more info on configuration folders see here: http://tools.android.com/tech-docs/configuration

Score: 11

In the latest Android Studio (as of this 2 edit, 4.1.1) you can go to Preferences -> Editor -> Code Style -> Scheme -> Settings Icon (Gear) -> Import Scheme... and import the 1 xml there.

Score: 8

If you are on Android Studio Preview you 2 will need to copy your style xml file to:

~/Library/Preferences/AndroidStudioPreviewX.X/codestyles

where 1 X.X is your Preview version ie. 1.4

Score: 7

Also, for those who use Android Studio on 3 windows. Copy your xml file to $USER_SPACE$\.AndroidStudio1.X\config\codeStyles. If you 2 don't have the codeStyles folder, just create 1 one. And then you will see it in Settings->Editor->Code Style->Scheme.

Score: 5

Here are steps I used to import my coding 1 style for a project.

  1. Place codingStyle.xml to .idea folder under your project.
  2. In Android Studio select Project for coding style scheme, click OK.
  3. Place original codingStyle.xml to .idea folder again (Android Studio most likely had overwritten with default settings your codingStyle.xml when you click OK on step 2)
  4. Restart Android Sturdio.

More Related questions