Plugin Project App Description

Source: Internet
Author: User

Main work:

    • Add App Productflavor, the same set of code can be compiled out plugins and apps
    • Carrying Launcherfragment with activity
    • Resolve Package Dependency Issues
    • Permission request (account permissions, CDE permissions)
    • Handling issues caused by package name changes
    • Add app Upgrade Features
    • Related UI, experience design

Use activity to carry the portal fragment

    • Add Entry Activity
    • Set Launcherfragment view to Activity's Contentview (lower view level than add fragment & avoid fragment recovery and rebuild issues)
    • Call Launcherfragment's life cycle function manually
    • Implements the interface of the previous host activity and provides a key implementation

Resolve Package Dependency Issues

Plug-ins Reference some of launcher's classes and functions, and plug-ins don't have to compile those classes into Dex, they just need to be compiled, so there are a lot of jars that are provided.

As a standalone app, you need to compile those jars inside Dex.

Two questions were encountered:

    1. Jar class Conflicts
      1. After changing to compile mode, the problem of Jar class conflict was encountered. The previous jar settings were unreasonable, and multiple jars would contain the same classes, and if all compile in, it would be a conflict.
      2. Workaround: Unpack the jar, delete the Extra class, repackage the jar (Java jar package compression, unzip the usage guide https://www.cnblogs.com/javastack/p/8761248.html).
    2. The number of methods exceeds 64K (there is already confusion and redundancy of resources)
      1. Many of the jars were not compiled into Dex, and the number of methods was exceeded after changing to compile mode.
      2. Processing method:
        1. Clean up code (delete old unused function code and related jar)
        2. Minus the dependency on fresco (in the case of plug-ins, Freso is not compiled into Dex.) App session Fresco will introduce a lot of code and so, we do not use most of the functions of imageloader, can be removed fresco. Fresco will also introduce so, as a system app, must put so to System/lib, now has a system application to put so to system/lib, if we also use fresco, then must consider so the version of the problem, high cost, error prone).

Permission request (account permissions, CDE permissions)

Before the host has the permission to apply for an account, as the app run, you must apply for account privileges, such as application for whitelist, etc.

Handling issues caused by package name changes

The host has uniformly modified the plug-in's package name, and in the plug-in, all the standard API-acquired package names are hosted. After changing to app, these APS get the package name that is the plugin's own package name.

The change of package name involves: Directed broadcast, advertisement SDK's judgment on package name, other sub-function's judgment on package name

App Upgrade Features

Plug-in upgrade is managed by the host, after the app session, you need to consider the upgrade function. There are two ways to upgrade:

    1. Use the store's silent upgrade feature
    2. Add your own upgrade logic &ui. With the Upgrade SDK, you can quickly complete the upgrade logic.

Related UI, experience design

    1. Logo
    2. Start diagram
    3. Big background &loading Background map
    4. Multi-desktop plug-in case, the left button, the upper key, the right button has a corresponding function, such as cutting the desktop, call out the notification bar. App, you can redefine these keys.

Plugin Project App Description

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.