Make sure that the bundled Android Support plugin is activated. This plugin provides Android support at the IntelliJ IDEA level and is enabled by default. If not, enable it as described in Enabling and Disabling Plugins.

Depending on the chosen module type, IntelliJ IDEA automatically sets up the correct module structure with the res and gen folders, downloads the necessary libraries, and generates various Android-specific descriptors.

Starting with the IntelliJ IDEA version 2016.1, non-Gradle Android projects are not supported.

Configuring the code style of Android-specific XML definition files

Android development involves working with dedicated XML files, such as layout and resource definition files, manifest files, etc. You can have IntelliJ IDEA apply the standard XML code style to such files, or configure custom code style settings for them.

Open the Settings / Preferences Dialog by pressing Ctrl+Alt+S or by choosing File | Settings for Windows and Linux or IntelliJ IDEA | Preferences for macOS. Expand the Editor node, and then click XML under Code Style.

To define a custom code style for Android-specific XML files, select the Use custom formatting settings for Android XML files checkbox and configure the settings to be applied to various types of Android XML files using the controls of the tab as described in Code Style:XML - Android.

To have IntelliJ IDEA format Android-specific XML files according to the standard XML code style settings defined in the other tabs of the page, clear the Use custom formatting settings for Android XML files checkbox.