public final class DynamicInstallMonitor


Monitor installation progress of dynamic feature modules. This class enables you to subscribe to the current installation state via getStatus. You also can perform various checks on installation state directly through this monitor.

In order to enable installation and monitoring of progress you'll have to provide an instance of this class to DynamicExtras.

Summary

Public constructors

Public methods

final void

Cancel the current split installation session in the SplitInstallManager.

final Exception

The occurred exception, if any.

final int

The session id from Play Core for this installation session.

final @NonNull LiveData<@NonNull SplitInstallSessionState>

Get a LiveData of SplitInstallSessionStatus with updates on the installation progress.

final boolean

Check whether an installation is required.

Public constructors

DynamicInstallMonitor

Added in 2.3.0
public DynamicInstallMonitor()

Public methods

cancelInstall

Added in 2.3.0
public final void cancelInstall()

Cancel the current split installation session in the SplitInstallManager.

getException

Added in 2.3.0
public final Exception getException()

The occurred exception, if any.

getSessionId

Added in 2.3.0
public final int getSessionId()

The session id from Play Core for this installation session.

getStatus

Added in 2.3.0
public final @NonNull LiveData<@NonNull SplitInstallSessionStategetStatus()

Get a LiveData of SplitInstallSessionStatus with updates on the installation progress.

isInstallRequired

Added in 2.3.0
public final boolean isInstallRequired()

Check whether an installation is required.

If this returns true, you should observe the LiveData returned by status for installation updates and handle them accordingly.

Returns
boolean

true if installation is required, false otherwise.