Android Application plug-in Development Solution

Source: Internet
Author: User

Android Application plug-in development solution 1. The actual requirements are generally described. After an Android Application is developed to a certain stage, more and more functional modules will be available, and the APK installation package will become larger and larger, during use, you cannot selectively load the required functional modules. In this case, you may need to consider how to split the entire application. 2. There are two ways to propose a solution. One is to split an application into multiple applications based on its functions, and download all the applications as needed. Applications can be associated at the code level to share part of the information. Another method is similar to other Platform Plug-ins. You can choose to download the required plug-ins in the main application. If you do not need this function, you do not need to download the plug-ins. The first method is to develop multiple applications. The second method is a little complicated and requires a lot of extra work. Here we will briefly discuss the general implementation method of the second method. Iii. Implementation Method overview some people may think, can I download a dll file or jar package like other platforms to automatically identify and load this function? Unfortunately, on the Android platform, the jar package cannot be directly loaded dynamically. The author did not think of a similar method. Therefore, to implement this function, you still need to load it in the form of an independent APK. Different from the first method, from the design perspective, a specific plug-in does not have an entry for independent operation, and desktop icons are not allowed to exist. It must be opened from the main application, go back to the main application. From the user's perspective, you can load and use the required functions in the application, which is similar to other Platform Plug-ins. In order to implement this method, from the design point of view, we need to consider which functions are provided to users as independent plug-ins. We will not detail them here. The following describes what needs to be done from the development perspective. Ø framework functions to be developed in the main application: identify whether the specific plug-in has been installed (based on the package name of the plug-in) if the version has been installed, determine whether to upgrade (the server obtains the latest version and compares it with the local version). Download and install (or upgrade) plug-in Uninstall this plug-in Ø considerations during plug-in APK development: do not provide the Start entry in the Manifest file. Tips for interaction between the main application and plug-in: it is best to use the same android: sharedUserId, the plug-in can easily obtain the resources and databases of the primary application. The main application can start a specific plug-in Intent mode, and bring Map type parameters or json string parameters to parse specific parameters in the plug-in APK to implement business logic. 3. Other Instructions: the content of this blog does not specifically describe how to implement it, and there is no code-level description. However, through the method described above, developers can basically understand how to implement plug-in Android applications. Specifically, developers may encounter many problems during the development process and need to explore and improve them themselves.

Related Article

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.