Just finally finished the plug-in development of the last article, the following to summarize, about the Android plugin from last November began planning, mainly from three aspects of the Android plug-in development principles. To be blunt, the plug-in development principle is: dynamic loading technology. However, we may encounter a lot of problems in the process of developing the plug-in, so here is divided into three articles for interpretation, but also gradually, to solve the plug-in development process may encounter problems, but these three is the basis of dynamic loading technology.
First, plug-in development Fundamentals: Dynamic Loading Technology interpretation
http://blog.csdn.net/jiangwei0910410003/article/details/17679823
This article mainly introduces the function of the Dexclassloader class in Android, and how we use dynamic loading technology, why we use dynamic loading technology and other issues such as the explanation, at the beginning, we use this class to do the function module stripping, let some modules placed in the specified jar/ dex/apk, and then go to dynamic loading, the benefit is that the size of the package is reduced and the functionality is more flexible.
Technical point: Dexclassloader's source code interpretation, use
Second, plug-in development begins: Class loader analysis
http://blog.csdn.net/jiangwei0910410003/article/details/41384667
This article focuses on the main two classloader in Android: Pathclassloader and Dexclassloader, their differences, connections, usage issues, and what common problems we encounter in the process of making plugins. This article is also the basis for the following two articles, because if you do not know these two classes, we will not be able to do the following.
Technical point: Pathclassloader class and Dexclassloader class of the source code interpretation, but not and contact between them
Third, plug-in development medium: Resource loading problem (skin-changing principle analysis)
http://blog.csdn.net/jiangwei0910410003/article/details/47679843
This article mainly through some of the application of the skin-changing technology to see, in the process of developing plug-ins How to solve some of the problem of resource loading, this question why to separate out to explain, because he is involved in a lot of knowledge, but also the basis of a later article, we need to load the resource files in the plugin. How to deal with it. This is explained in detail here. At the same time, with this technology, we can achieve the application of skin-changing development.
Technical point: Dynamic load resources, Assetmanager class of source code interpretation
The end of plug-in development: Dynamic load activity (free install run program)
http://blog.csdn.net/jiangwei0910410003/article/details/48104455
This article mainly explains how to load the activity in the plugin. This allows for installation-free operation, and this article is a comprehensive use of the knowledge of the first three articles. Many applications will use plug-in technology, because the size of the package and the priority of some features to determine which modules can be made into plug-ins. This article also describes two ways to dynamically load activity. There are advantages and disadvantages to both of these approaches.
Technical point: Two ways to load activity,loadedapk class and Activitythread class source code interpretation
Summarize
Its own Android dynamic loading technology is very popular, I just came into contact with this technology, is exactly the year I graduated from college that 2013. We needed to do the aggregation advertising SDK, so we needed to deal with each ad, using dynamically loaded technology to load the SDK for each ad. The first time I was exposed to dynamic loading, I was still very excited because of the feeling. The code can also be written like this. function of stripping so well. So it's obsessed with the technology. Later just because of personal interest, began to delve into the plug-in development technology, of course, the essence or dynamic loading, just need to solve a specific problem. Now there are a lot of Daniel wrote some framework, personally feel the best is this buddy wrote framework:
Https://github.com/Qihoo360/DroidPlugin
Haha, look at the name to know is 360, hey, have to admire the domestic technical research what the 360 companies can be considered relatively good.
Of course, I believe that with the passage of time, there will certainly be more cattle people to study this technology, to develop a more perfect framework, I am very much looking forward to it.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Summary and overview of plugin development in Android