File | Project Structure | Modules - module - Android facet
Use this page to configure individual settings of an Android facet attached to a specific module.
In this section:
Common Android Facet options
In this area, configure Android platforms to build the application against, choose the platform to use in the current module, and enable or disable sharing the module source code and resources.
|Library module||Select this check box to enable using the module as library project so Android application projects can reference its source code and resources.|
|Reset paths to defaults||Click this button to return to the default Android facet settings.|
In this tab, specify the location of the key application components in the module tree structure. Based on these settings, IntelliJ IDEA supports code completion, resolves references, and provides other types of coding assistance.
|Manifest file||In this text box, specify the path to the AndroidManifest.xml file. The AndroidManifest.xml file should be located in the module root directory.|
|Resources directory||In this text box, type the path to the folder where the application resources are stored. Resources located in this directory are assigned IDs and can be referenced through the R.java file or from XML resource definition files. The default location is <module root>/res.|
|Assets directory||In this text box, type the path to the folder where the application assets are stored. Files located in this directory are not assigned IDs and cannot be referenced through the R.java file or from XML resource definition files. You can access this directory like a normal file system and read data from these files using the AssetManager. The default location is <module root>/assets.|
|Native libs directory||In this text box, type the path to the folder where the Android native libraries.. The default location is <module root>/libs.|
In this tab, configure the behaviour of various Android compilation tools.
|R.java and Manifest.java files||
In this area, appoint the folder to store the R.java file
with the IDs of all the resources defined in your project and the AndroidManifest.java file with permissions.
Both files will be generated automatically based on the definitions of resources
and the AndroidManifest.xml file respectively.
By default, IntelliJ IDEA suggests to store the generated files in the gen folder. To change this setting, type the path to the required folder manually in the Directory for generated files text box or click the Browse button and select the folder in the dialog box that opens.
|AIDL files||In this area, appoint the folder to store the .aidl files generated by the AIDL Compiler. Accept the location suggested by IntelliJ IDEA in the Directory for generated files text box, or type the path to another folder manually, or click the Browse button and select the folder in the dialog box that opens.|
In this area, configure the behaviour of the Android Asset Packaging Tool (aapt) that is responsible for creating an Android Package
.apk file and specify the location of components to be included in it.
In this area, enable the ProGuard tool to obfuscate the application
|APK Path||In this drop-down list, specify the target directory for the .apk file, which is obtained as a result of Android module compilation. Choose the APK path from the list or click the Browse button and choose the desired folder in the Select Path dialog box that opens.|
|Custom debug keystore||
In this text box, specify the location of the keystore to use the debug key from. Type path manually or click the Browse button
and appoint the location in the dialog that opens.
By default, debug keys are stored in <user home>/.android/debug.keystore>. When using builds created on different machines, they all have different signing, so you have to uninstall the existing application before installing the application from another machine. To solve this problem, keystore files are often stored in a version control system alongside the source code. To have IntelliJ IDEA use the repository keystore instead of the default one, specify the relevant location in the Custom debug keystore field.
|Include test code and resources into APK||Select this check box to include the sources and resources, located under the test roots, into the debug APK,
which is created in course of project build.
(Test data is never included in the release APK, which is created via the Export signed application package wizard.
Note that check box is cleared by default this for the regular Android modules; for the test modules this check box is selected by default.
|Pre-dex external jars and Android library dependencies||
The main goal of declaring a module as library module and attaching it to other projects is re-using the components from the library module. During the application packaging, the .class files of the library module are converted into .dex files, this operation is referred to as dexing. Finally the .dex files output from the library module are included in the final application .apk. Learn more about the building procedure at http://developer.android.com/tools/building/index.html.
It often happens, that the contents of a library module remain unchanged. In this case you can have them dexed only once whereupon the output .dex files are included in .apk. This approach is referred to as pre-dexing.
By default, IntelliJ IDEA pre-dexes library mode dependencies as well as external jars that have not been updated since the previous build. You can change this settings so all .class files are always dexed.
The check box is not available in modules of the type Library.