How do I refer to another module in the module?
Method One:
Google provides its own reliance, compile introduction needs to use the module.
Method Two:
Each module will eventually be compiled into a corresponding suffix for the Aar file < \modulename\build\outputs\aar\xxx.aar>, refer to this file directly in the module you need to use. The introduction of the Aar file here is slightly different from the direct reference module, as follows:
The first step: you need to first add the following code under android{} under Build.gradle in the host module:
Repositories { Flatdir { ' libs ' }}
Step Two: Add Dependencies
Compile (name: ' Aarname ', ext: ' AAR ')
How the jar files in the outer module are used in the host module?< only describes the solutions on Android studio3.0 >
Compile is a way that Google offers to introduce external class libraries before Android Studio 3.0. After Android studio3.0 compile was replaced by implementation and API in two ways.
Implementation: If you are importing a jar file under a local libs file, it means that the jar file is only available in the current module and cannot be used directly from the externally referenced module.
API: If you are importing a jar file under a local libs file, it means that the jar file can be used not only in the current module, but also externally referenced by the module.
Compile only: As the name implies, it is not packaged into the apk when it is actually packaged.
Runtime only: Packaged in the APK, not compiled (feel useless)
Nothing else to say .....
Android Studio3.0 references the nature of the module and shares the module to other module