LibraryLoader
@UnstableApi
abstract class LibraryLoader
Configurable loader for native libraries.
Summary
Public constructors |
|---|
LibraryLoader(libraries: Array<String!>!) |
Public functions |
|
|---|---|
synchronized Unit |
setLibraries(libraries: Array<String!>!)Overrides the names of the libraries to load. |
Protected functions |
|
|---|---|
abstract Unit |
loadLibrary(name: String!)Should be implemented to call |
Public properties |
|
|---|---|
Boolean |
Public constructors
Public functions
setLibraries
synchronized fun setLibraries(libraries: Array<String!>!): Unit
Overrides the names of the libraries to load. Must be called before any call to isAvailable.
Protected functions
loadLibrary
protected abstract fun loadLibrary(name: String!): Unit
Should be implemented to call System.loadLibrary(name).
It's necessary for each subclass to implement this method because loadLibrary uses reflection to obtain the calling class, which is then used to obtain the class loader to use when loading the native library. If this class were to implement the method directly, and if a subclass were to have a different class loader, then loading of the native library would fail.
| Parameters | |
|---|---|
name: String! |
The name of the library to load. |