A description of Life scene
Because the company has a project development time is relatively long, the project is stacked code is more, and some of the features in the release of different customers when some features do not need, so the separation of functional modules is very necessary.
Therefore, the library was pushed to the front desk, we use it.
Second, the matters needing attention
1. Two libraries cannot refer to each other
The drawable file in 2.Library cannot be used in the project (this item needs further confirmation)
3. Gets the file Object Context.getassets () in the library because the context object used in the project belongs to the current project. Open ("FileName.txt"); The file should be placed in the project's assets. (The item needs further confirmation)
The view injection framework (e.g.Bufferknife) cannot be used in 4.Library because the IDs of the files in the library R file are static variables and constants are required (constants are generated in the Android project). However, if the framework is placed in the library, the framework can be used in the project.
5.Library can have its own sub-Library
6. Cache problem: If the code in a sub-library is modified in the encoding, the parent library cannot load the modified code in the sub-Library, it needs to dereference the library and import the reference.
7. If you use activity in the library, you need to redefine it in the androidmanifest.xml of the project. Because the manifest configuration file is independent to the project, it cannot be reused. You can not declare activity in the library, but you must declare it in project.
8. Resources in the project will overwrite resources in the library if the resource name is the same.
9. A reference definition will be available in the properties file after using the library.
The 10.Android library can reuse Java classes, Android components, and resources, but assets resources are not reused.
11. Question: What if two sub-libraries need to refer to each other's activity?
Android Development is the library chapter