[go: nahoru, domu]

tree: efd1cbbb5ac678d413e0d06eda9528af190bedec [path history] [tgz]
  1. android/
  2. DIR_METADATA
  3. OWNERS
  4. readme.md
components/module_installer/readme.md

Chrome on Android Dynamic Feature Module Installer Backend

This component houses code to install and load Android dynamice feature modules. See the onboarding guide for how to create such a feature module in Chrome. Broadly, this component offers two APIs

  • install engine to install modules and module builder to set up modules on first access.

Install Engine

The install engine is a wrapper around Play Core's split install API that performs extra setup such as SplitCompat, and collects metrics. You can install a module by name with the following code snippet:

InstallEngine installEngine = new EngineFactory().getEngine();
installEngine.install("foo", success -> {
    // Module installed successfully if |success| is true.
});

You can use the install engine on its own but will have to take care of module setup such as loading native code and resources. To simplify that you can use the module builder API.

Module Builder

The module builder simplifies module set up by loading native code and resources on first module access and determines whether a module is installed. The module builder uses the install engine in the back. It primarily provides the following building blocks: