What is a plugin fragment? (What is a plug-in clip ?)

Source: Internet
Author: User

Fragment can be considered as a small segment of the plug-in,
Sometimes it can be used in the plug-in. If you want to use it, you can install, uninstall, update, etc. You can think that fragment is attached to the plug-in. In fragment, you only need to specify its host plugin, after this parameter is specified, fragment can be referenced toCode, As shown below

Fragment can be used to save many other information about plugin. For example, a plug-in may have a lib package, which is applicable to a specific operating system, window system, or language pack, these can be added to fragment as plug-in information, recorded by fragment. Create a fragment and associate it with its host plugin. In any case, fragment and plugin are similar in files, but there are also some differences, such:

 

1>. In fragment, a lot of information exists in fragment. XML, while in plugin, there is in plugin. xml.

2>. The root node of the file in fragment is <fragment/>, and the value is <plugin/>.

3>. fragment can automatically inherit the code in host plugin or directly reference it. However, the host plugin cannot depend on fragment.

 

 

Apart from this, a fragment can be said to be no different from plugin. It also has its own Lib, extensions, and so on. When fragment is loaded by the plug-in platform, it is logically incorporated into the host plugin, rather than physical integration. You can directly copy the items in manifest in fragment to the host plugin. Therefore, the classpath required by fragment can also be written to the host plugin. As mentioned above, classes in fragment can be directly written to hostplugin, or directly referenced to the class in host plugin, or even some plublic methods. Some methods can be used to find and open plugin. These are the relative paths installed by some plug-ins of the parameters. They can all be localized or read from the fragment installation path.

 

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.