Android Plug-in APK development Program

Source: Internet
Author: User

Currently the most popular smartphone operating system for smartphones is Android's mobile operating system, which has received a 70%.1 concern, with iOS and Aliyun's "Cottage Android" being 15.9% and 2.9%, respectively. For this is just launched by the vast number of developers love products. In general, an Android application after the development of a certain stage, the functional modules will be more and more, the APK installation package is also growing, users in the use of the process also has no way to selectively load their own required functional modules. It may be time to consider how to split the entire application, so the need for Android plug-in development is growing.

One might think that it is possible to download a DLL-like file, or a jar package, like other platforms, to automatically recognize and load the feature? Unfortunately, the Android platform is not allowed to dynamically load the jar package, the author did not think of a similar approach. So, if you want to implement this function, you need to load it in a separate apk way. And the first way is different from the design point of view, the specific plug-ins are not independent operation of the portal, nor allow the existence of desktop icons, must be opened from the main application, closed back to the main application. From the user's point of view, you can load the required functionality in your application and use it, similar to the way other platform plug-ins do.

To implement this approach, from the perspective of plug-in development, it is necessary to consider which features are provided to the user as stand-alone plug-ins, no longer detailed here. Here's what you need to do roughly from a development perspective.

1, the main application needs to develop the framework function:

Identify whether the specific plug-in is installed (according to the plugin's package name)

If you have already installed to determine if you need to upgrade (server-side get the latest version and local comparison)

Download and install (or upgrade) the plugin

Uninstall the Plugin

2, plug-in APK development need to pay attention to the matters:

Do not provide a boot entry in the manifest file.

3, the main application and plug-in interaction between the tips:

It is best to use the same Android:shareduserid, Plug-ins can easily get the main application of resources, databases and so on.

The main application can launch the specific plug-in in intent mode, bring into the map type parameter or the JSON string parameter, parse the specific parameter in the Android plug-in development APK, realize the business logic.

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.