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

Public methods

loadLibrary

public 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. This method should be used by instant apps 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

public static 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