The Android Developer Challenge is back! Submit your idea before December 2.

SplitInstallHelper

public class SplitInstallHelper
extends Object

java.lang.Object
   ↳ com.google.android.play.core.splitinstall.SplitInstallHelper


Helper class that includes utilities that your app can use to retrieve information about available, installed split APKs.

For example, you use this API after a split install to refresh the app Context and access code and resources from installed modules.

Summary

Public methods

static void loadLibrary(Context context, String libName)

Loads a native library using a classloader, or a full path if the library is not available in the class path.

static void updateAppInfo(Context context)

Updates application info based on currently installed splits.

Inherited methods

From class java.lang.Object

Public methods

loadLibrary

void loadLibrary (Context context, 
                String libName)

Loads a native library using a classloader, or a full path if the library is not available in the class path. This method should be used to load a library from a newly installed split.

Note: For instant apps, you need to call updateAppInfo(Context).

For more information and examples, see Load C/C++ libraries.

Parameters
context Context: The app Context

libName String: The library name

Throws
UnsatisfiedLinkError
UnsatisfiedLinkError

updateAppInfo

void updateAppInfo (Context context)

Updates application info based on currently installed splits.

For instant apps on Android 8.0 (API level 26) and higher, you must call this API when a split is installed, so that app components can see code and resources from the new splits.

This method updates application info reference in application thread object.

You must call this API on Android 8.0 and 8.1. It's a no-op on all other versions, so it's safe to call.

For more information and examples, see Access code and resources from installed modules.

Parameters
context Context: application context