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

Should be implemented to call System.loadLibrary(name).

Public properties

Boolean

Public constructors

LibraryLoader

LibraryLoader(libraries: Array<String!>!)
Parameters
libraries: Array<String!>!

The names of the libraries to load.

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.

Public properties

isAvailable

val isAvailableBoolean