Introduction to Baby Bus Android framework
本文从以下几个方面介绍框架:1、框架的设计思路2、这样设计的好处3、框架的结构图4、每个library的介绍5、结合打包工具来使用
Design idea of frame
Because Android has the library (component) concept, that is, many functions can be separated into components, when needed to add to the project. Therefore, we have separate function modules made into a single library. Such as:
Description: Bbframework is a framework project. Bbmodule_plugin, all the library components.
The benefits of design 1, the realization of what needs to use what
If all the functions are placed in the same project, it will inevitably cause the APK package to be too large. Component plug-in development, so that the project will only use the components it needs to ensure that the app does not have unnecessary function code and resources.
2. Flexible switching of advertising platform
Each different advertising platform, we are all made up of independent components, so for different channels, can be flexible to replace the different advertising SDK.
3, easy to maintain, will not affect the other app's package progress
Each library can be packaged separately into a jar to be introduced into the project. If this plug-in problem, the first to remove the development, and will not affect the other app's package progress.
Structure diagram of the frame
Description: The dashed line represents pluggable. Implementation represents non-pluggable. The direction of the arrows represents the reference relationship. From the know, Plugin_systemjni this unative component, is not to leave Bbframework.
Combined with the use of packaging tools
We use the idea of reflection to manage resources, so that when packaged, you can not be bothered by R file references. Each library will generate a separate jar package for use by the packaging tool.
Introduction to Baby Bus Android framework