– My history with plugins

If you know me, if you’re an old friend, if you’ve read my CSDN blog, it’s no exaggeration to say that I have a long history with plugins.

Back in March 2014, I published my first article on plugins in CSDN, “A Study of Android APK dynamic loading Mechanism”. Although it seems pretty weak now, it got a lot of attention at the time.

A month later, I published a second article, “A Study of Android APK Dynamic loading mechanism (II) : Resource loading and Activity Lifecycle Management,” which played a very important role in the early development of plug-ins. The rest is known to all. Other students and I continued with this matter and finally opened source dynamic-load-APK on GitHub, which attracted great attention in the industry at that time.

Now come to think of it, dynamic-load-APK actually promoted the development of plug-in framework in China, making plug-in technology to reach an era of contention. If it weren’t for dynamic-load-APK, this might not be the case today, and you might still not know the details of plug-in technology.

– Make core technologies available to the public

Do you know why I open source dynamic-load-APk? Well, there’s a story here.

As early as 3 years ago, when Android development was just emerging, I was just a beginner of Android for 2 years, and I was also an ordinary Android engineer. But one day, in our company, I learned that there was a technology called plug-in, which could run an APK directly. I love Android, so I was really curious to see how it would work.

However, I was in a low level at that time, and plug-in was the core technology of the company, so I could not obtain plug-in code. I felt depressed, so I began to search the knowledge of plug-in from the Internet, but almost nothing was found at that time. I also knew that Ali had an Atlas plug-in framework, but ali wouldn’t open source either.

I wanted to know the technical details of plug-ins, and I wanted to make this core technology available to millions of ordinary engineers, and I decided to work on a plug-in framework myself. This was an incredible thing at that time. After many hardships and without any reference, several other students and I finally explored a set of plug-in framework, which is the origin of Dynamic-Load-APK. Although dynamic-load-APK looks weak now, it still plays an indelible role.

So, I think you should take this opportunity to learn more about the plug-in framework, which is absolutely the core technology in the Android space.

Technology that used to be invisible to many people is now open source and accessible to everyone. Why not look at it and study it?

– Why VirtualAPK?

Because dynamic-load-APk is so old and constrconstrs the plug-in development process so much, I’ve always wanted to develop a more powerful plug-in framework and open source it for the benefit of other companies. Due to an opportunity, I was able to join Didi to fulfill my unfinished dream. On June 30th of this year, after a year of iteration and validation, VirtualAPK was finally open source, and my dream was finally fulfilled!

– Application scenarios of VirtualAPK

Fully functional

  • Support for almost all Android features;

  • Four components

None of the four components need to be pre-registered in the host MANIFEST, and each component has a full life cycle.

  1. Activity: supports display and implicit invocation, supports Activity theme and LaunchMode, and supports transparent themes;

  2. Service: support explicit and implicit calls, support the start, stop, bind and unbind of services, and support cross-process bind plug-in Service;

  3. Receiver: Supports static registration and dynamic registration.

  4. ContentProvider: Supports all operations of the provider, including CRUD and Call methods, and supports cross-process access to the provider in the plug-in.

  • Custom View: support custom View, support custom attributes and style, support animation;

  • PendingIntent: Supports PendingIntent and its associated Alarm, Notification, and AppWidget.

  • Support meta-data in the plug-in manifest and Application;

  • Support for SO in plug-ins.

VirtualAPK vs. other major open source solutions:



– Technical principles of VirtualAPK



VirtualAPK technology implementation, divided into two parts, one part is the engine part, this part is responsible for plug-in loading and running; The other part is the build part of the plug-in, which is responsible for compiling the plug-in, handling the plug-in and host dependencies, and so on.

There have been many articles on the engine part, but not on the construction part, and we will write another article on that.

In order to further spread the ability of VirtualAPK, let more people know and benefit more developers, the VirtualAPK development team will hold a Live on Zhihu this Saturday afternoon, and I am also the keynote speaker. For the first time in Live, we’ll be revealing the technical details of the VirtualAPK builder, and it’ll be a great learning experience.

In fact, we have also considered other forms, but selectively or other Live platform are less serious and technical norm, the current technology pretend bility higher platform only zhihu, but it is paid on zhihu, our intention is to spread technology, really is not for profit, the Live all by drops company unified handling, We, the four speakers, don’t get any share, none at all.

So, if you’re interested in plugins, you should really sponsor them for 10.24 RMB. In other words, as an Android programmer, is there any reason not to be interested in plugins? Do not understand plug-in how brag force? How can you be a senior engineer if you don’t know about plug-ins?

As for me, three years ago, I could not attend Live to learn plugins no matter how much money I wanted to spend, because no one was willing to reveal to you, they were all tucked away, a handful of bitter tears!

Best, for everyone girl picture, every girl picture is my heart prepared for you.

You can click on the bottom to read the original text and go directly to zhihu Live’s address. You can also identify the QR code in the picture below to go directly to Live. If you read this post and are sponsoring this Live, please comment in the comments. I want to see how many people are on the road to open source. I’m not alone, am I?