Android MAVEN Package Bulk Replace resource file (overlay skin) &aar Packaging Dependency Module overlay policy

Source: Internet
Author: User

1.AAR Packaging Coverage

The main module (APK) overwrites the same name resource in AAR:

The policy is as follows:

Resource file examples, layout is the use of the cover method. The values file, such as Strings.xml, is in merge mode.
Dependent modules can only be packaged using AAR, such as a two-party library such as a UI library.It is recommended to put all the common resource resources in the common module, and establish the corresponding naming mechanism to prevent duplication.
In the future, if there is a business-independent module can be played as a bundle,bundle can be seen as a standalone apk, with a separate resource file
2. MAVEN supports specifying the RES directory at compile time (similar to Android overlay). Specific as follows:

                 <artifactId>android-maven-plugin</artifactId>                  <configuration>+                    < resourceoverlaydirectories>+                        <dir>res-overlay</dir>+                    </resourceoverlaydirectories >

Add the Resourceoverlaytdirectioies node to the configuration node of the Android Maven-plugin, and set the overlay directory.

When packaged, Res-overlay replaces the resource file with the same name under Res.

Can be used to change skin, replace different versions of resource files.



Reference:

Https://code.google.com/p/maven-android-plugin/wiki/ApkSourcesDependency

Https://code.google.com/p/maven-android-plugin/wiki/Changelog

Android Overlay:

http://my.oschina.net/kingguary/blog/160190

Android MAVEN Package Bulk Replace resource file (overlay skin) &aar Packaging Dependency Module overlay policy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.