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, collects metrics and provides fake install. 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: