Android Plugin Framework

Source: Internet
Author: User


    1. 1. dynamic-load-apk/dl dynamic load frame


is a proxy-based implementation of the plug-in framework, the application of the surface of the processing, by registering the agent component in the Manifest, when the plug-in component is started, first start a proxy component, and then through this proxy component to build, start the plug-in component. Need to follow certain rules to develop the plug-in APK, the components in the plug-in need to implement the modified Activity, fragmentactivity, Service, and other sub-classes.



The advantages are as follows:


    • Dynamic upgrade,
    • Efficient Parallel Development (faster compilation)
    • Load on demand, lower memory consumption, etc. dynamicloadapk provides 3 development methods that allow developers to quickly integrate plug-in functionality without having to understand how they work.
    • Plugins need to follow certain rules, so the security aspects can be controlled.
    • The scheme is simple and suitable for the plug-in transformation of its own small amount of code.
    • Plugin from the host without installation.
    • Supports access to plugin resources with R
    • Plugin supports Activity and fragmentactivity (other components will be supported in the future)
    • Basic No reflection call
    • The plug-in can still be run independently for easy commissioning after installation
    • Support for 3 kinds of plugin to host the call mode:


(1) No call (but can still be called with reflection).



(2) Partial call, host can expose some interface for plugin call. The first two modes are for situations where the plugin developer cannot get the host code.



(3) Full invocation, plugin can fully invoke host content. This mode is suitable for plugin developers to get the host code.


    • Create plug-ins efficiently with a single jar package of DL, and the DL process is completely transparent to developers
    • Support for android2.x version





Disadvantages are as follows:


    • The method that calls the component through this is not supported and needs to be called through that.
    • Because the activity in the APK is not registered, it is not supported to implicitly invoke the activity inside the APK.
    • In the process of writing and rebuilding plug-ins, it is necessary to consider compatibility issues more, and it will be more time-consuming and laborious to tune up.
    1. 2. droidplugin


Droidplugin is a mobile phone helper implementation of a plug-in framework, it can directly run a third-party standalone APK file, no need to modify or install the APK. A new plug-in mechanism, a free-to-install operating mechanism, is a sandbox (but not a complete sandbox). Is the basis of modularity for users who do not know what he will do with the APK.



The advantages are as follows:


    • Supports Android four components, and the components in the plugin do not need to be registered in the host APK.
    • Support Android 2.3 and above system, support all system API.
    • Between plug-ins and plugins, the plug-in is completely separated from the code and resources of the host.
    • Implementation of process management, plug-in empty process will be timely recovery, low memory consumption.


Disadvantages are as follows:


    • Plugin APK does not support custom resource Notification, notification bar restrictions.
    • The four components with special Intentfilter cannot be registered in the plugin APK.
    • Because plug-ins and plugins are completely isolated from the code between the plug-in and the host, plug-ins and plug-ins communicate with the host only through the Android system-level communication.
    • Security concerns (can be modified, hook some important information).
    • Model adaptation (not available on all machines, because a large number of reflection-related, if the ROM vendor depth customization of the framework layer, reflection of the method or class is not, easy to use the plug-in failure)


1.3. Small frame



Small is a lightweight, cross-platform, plug-in framework that is based on the concept of "lightweight, transparent, minimal, cross-platform" and tends to be more modular. The interface of the jump plugin is specified by the URI.



The advantages are as follows:


    • All plugins support the built-in hosting package.
    • The use of plug-in encoding and resource files is no different from common development applications.
    • By setting the URI, the host and Native application plug-ins, web plugins, online Web pages and so on can be easily communicated.
    • Supports Android, IOS, and HTML5, and three can communicate via the same Javascript interface.


Disadvantages are as follows:


    • Dynamic registration of the service is not supported, although this can be circumvented by pre-registering the service in the host's Androidmanifest.xml file, because the service is often very low in update frequency.
    1. 4. dynamicapk(Ctrip)


Modular framework, currently discontinued


    1. 5. Androiddynamicloader


There are too many limitations through fragment implementations.


    1. 6. ACCD Ali


Acddcore Android Dynamic Deployment Framework (you can think of plug-ins, but not the same as plug-ins), and the traditional plug-in is not the same, the use of agents should know that the proxy way there will be a variety of inexplicable problems.













Android Plugin Framework


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.