Stay organized with collections
Save and categorize content based on your preferences.
SplitInstallHelper
public
class
SplitInstallHelper
extends Object
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
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
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 |
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
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# SplitInstallHelper\n\nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nSplitInstallHelper\n==================\n\n\n`\npublic\n\n\nclass\nSplitInstallHelper\n`\n\n\n`\n\nextends `[Object](https://developer.android.com/reference/java/lang/Object.html)`\n\n\n`\n\n`\n\n\n`\n\n|---|--------------------------------------------------------------|\n| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||\n| ↳ | com.google.android.play.core.splitinstall.SplitInstallHelper |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nHelper class that includes utilities that your app can use to retrieve information about\navailable, installed split APKs.\n\nFor example, you use this API after a split install to refresh the app Context and [access code\nand resources from installed modules](https://d.android.com/guide/playcore/dynamic-delivery#access_installed_modules).\n\nSummary\n-------\n\n| ### Public methods ||\n|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` static void` | ` `[loadLibrary](../../../../../../../reference/com/google/android/play/core/splitinstall/SplitInstallHelper.html#loadLibrary(android.content.Context,%20java.lang.String))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[String](https://developer.android.com/reference/java/lang/String.html)` libName) ` Loads a native library using a classloader, or a full path if the library is not available in the class path. |\n| ` static void` | ` `[updateAppInfo](../../../../../../../reference/com/google/android/play/core/splitinstall/SplitInstallHelper.html#updateAppInfo(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) ` Updates application info based on currently installed splits. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` boolean` | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` `[String](https://developer.android.com/reference/java/lang/String.html) | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic methods\n--------------\n\n### loadLibrary\n\n```\npublic static void loadLibrary (Context context, \n String libName)\n```\n\nLoads a native library using a classloader, or a full path if the library is not available in\nthe class path. This method should be used by instant apps to load a library from a newly\ninstalled split.\n\nNote: For instant apps, you need to call [updateAppInfo(Context)](../../../../../../../reference/com/google/android/play/core/splitinstall/SplitInstallHelper.html#updateAppInfo(android.content.Context)).\n\nFor more information and examples, see [Load C/C++\nlibraries](https://d.android.com/guide/playcore/dynamic-delivery#load_native_libs).\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|-----------------------------------|\n| `context` | `Context`: the app Context \u003cbr /\u003e |\n| `libName` | `String`: the library name \u003cbr /\u003e |\n\n| Throws ||\n|-----------------------------------------------------------------------------------------------------|----------------------|\n| | UnsatisfiedLinkError |\n| [UnsatisfiedLinkError](https://developer.android.com/reference/java/lang/UnsatisfiedLinkError.html) | |\n\n**See also:**\n\n- [System.loadLibrary(String)](https://developer.android.com/reference/java/lang/System.html#loadLibrary(java.lang.String)) \n\n### updateAppInfo\n\n```\npublic static void updateAppInfo (Context context)\n```\n\nUpdates application info based on currently installed splits.\n\nFor instant apps on Android 8.0 (API level 26) and higher, you must call this API when a\nsplit is installed, so that app components can see code and resources from the new splits.\n\nThis method updates application info reference in application thread object.\n\nYou must call this API on Android 8.0 and 8.1. It's a no-op on all other versions, so it's\nsafe to call.\n\nFor more information and examples, see [Access\ncode and resources from installed modules](https://d.android.com/guide/playcore/dynamic-delivery#access_installed_modules).\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|---------------------------------------|\n| `context` | `Context`: application context \u003cbr /\u003e |"]]