Class NativeLibrary

java.lang.Object
com.facebook.soloader.NativeLibrary

public abstract class NativeLibrary extends Object
This is the base class for all the classes representing certain native library. For loading native libraries we should always inherit from this class and provide relevant information (libraries to load, code to test native call, dependencies?).

This instances should be singletons provided by DI.

This is a basic template but could be improved if we find the need.

  • Method Details

    • loadLibraries

      @Nullable public boolean loadLibraries()
      safe loading of native libs
      Returns:
      true if native libs loaded properly, false otherwise
    • ensureLoaded

      public void ensureLoaded() throws UnsatisfiedLinkError
      loads libraries (if not loaded yet), throws on failure
      Throws:
      UnsatisfiedLinkError - UnsatisfiedLinkError
    • getError

      @Nullable public UnsatisfiedLinkError getError()