Android Maven package bulk replacement of resource files (overlay for skin) & amp; AAR package dependency module overwrite Policy

Source: Internet
Author: User

Android Maven package bulk replacement of resource files (overlay for skin) & amp; AAR package dependency module overwrite Policy

1. AAR package and overwrite

The primary module (APK) overwrites resources of the same name in AAR:

The policy is as follows:

 

Resource file examples. layout overwrites resources. The values file, such as strings. xml, is merged.
Modules with dependencies can only be packaged using aar, such as the ui Library and other libraries. We recommend that you add the resources shared by all modules to the common module and create a naming mechanism to prevent duplication.
In the future, if there are business-independent modules that can be bundled into bundle, bundle can be seen as an independent apk with independent resource files
2. maven supports specifying the res directory during compilation (similar to Android overlay ). The details are as follows:

 

 

Android-maven-plugin

 
  
+

  
   
+

   
    
Res-overlay

   +

  

 

Add the resourceOverlaytDirectioies node to the configuration node of android maven-plugin and set the overlay directory.

 

During packaging, res-overlay replaces resource files with the same name under res.

It can be used to change the skin and replace resource files of different versions.

 

 

Related Article

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.