Google's official website study notes

About Support Package:

Original: part name support library packages indicate their initial support of the minimum API level. These names using the v # notation, such as support-v4 package. 26.0.0 (July 2017 release) from a support library release, all supported library packages supported by the lowest level API has been changed to Android 4.0 (API level 14). Therefore, when using any of the latest version of the support library, you should not assume that v # packages notation indicates the lowest level API support. Equivalent latest version of this change also means that the name of the library packages v4 and v7 supports its lowest level API nature. For example, for a minimum API level 26.0.0 or a later version of the support library, support-v4 and support-v7 package supports both 14.

Specifically, the release numbers available when the first portion (e.g., version 24.2.0 24) generally corresponding to the release version of the API corresponding to the version of the platform. Support Library releases levels can indicate this version incorporates some of the features of the corresponding API, but you should not assume that it is compatible with all the features of the new version of the API platform release.

Understanding: for 26.0.0 and later, the minimum version v4 and v7 repository library support is the same, but less than the version 26.0.0 is not necessarily. Which, v7 library contains v4 library

 

About memory allocation system:

Because the next Android system, each user APP is an independent, Android system assigns to the user's memory is very small, usually only about 32MB 64MB
This configuration file is generally /system/build.propin.

 

Change Resource Directory:

By default, your resources are located  module-name/src/source-set-name/res/. For example, the main source code file resource module set is located  src/main/res/, source code files set debug resource is located  src/debug/res/.

However, you can use  sourceSets {} block  res.srcDirs properties to change these paths to any other location (relative to the  build.gradle file). E.g:

android {
        sourceSets {
            main {
                res.srcDirs = ['resources/main']
            }
            debug {
                res.srcDirs = ['resources/debug']
            }
        }
    }
    

You can also set a source code file, specify multiple resource directories, compiler tools they will merge together. E.g:

android {
        sourceSets {
            main {
                res.srcDirs = ['res1', 'res2']
            }
        }
    }
    

 About merging resources:

The final APK file resource may have three different sources:

If all the resources from every set of source code files or libraries is unique, they will eventually be added to the APK. If the file name of a resource in its resource type directory and resource qualifier (if defined) is unique in, the system will be seen as the only resource.

If there are two or more of the same resource matching versions, only one will be included in the final version of the APK. Compile tool will select the version you want to keep the following order of priority (the highest priority on the left side):

Compile variant> coding type> Features> Main source fileset> object dependencies

For example, if the primary set of source code files comprising:

  • res/layout/foo.xml
  • res/layout-land/foo.xml

Compile and debug types include:

  • res/layout/foo.xml

APK will eventually include the debug compiled from the type  res/layout/foo.xml and source code files from the main set  res/layout-land/foo.xml.

However, when you compile the configuration for a given set of source code files specified multiple resource folder , if there is a conflict between these sources, an error occurs, and the merger will fail, because the priority of each resource directory the same.

Published 41 original articles · won praise 8 · views 20000 +

Guess you like

Origin blog.csdn.net/huma8848888/article/details/103256487