Java Code Examples for com.facebook.soloader.SoLoader#loadLibrary()

The following examples show how to use com.facebook.soloader.SoLoader#loadLibrary() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ReactBridge.java    From react-native-GPay with MIT License 5 votes vote down vote up
public static void staticInit() {
  // No locking required here, worst case we'll call into SoLoader twice
  // which will do its own locking internally
  if (!sDidInit) {
    SoLoader.loadLibrary("reactnativejni");
    sDidInit = true;
  }
}
 
Example 2
Source File: ReactContextBuilder.java    From react-native-threads with MIT License 5 votes vote down vote up
private JavaScriptExecutorFactory getJSExecutorFactory() {
    try {
        String appName = Uri.encode(parentContext.getPackageName());
        String deviceName = Uri.encode(getFriendlyDeviceName());
        // If JSC is included, use it as normal
        SoLoader.loadLibrary("jscexecutor");
        return new JSCExecutorFactory(appName, deviceName);
    } catch (UnsatisfiedLinkError jscE) {
        // Otherwise use Hermes
        return new HermesExecutorFactory();
    }
}
 
Example 3
Source File: CxxModuleWrapper.java    From react-native-GPay with MIT License 4 votes vote down vote up
public static CxxModuleWrapper makeDso(String library, String factory) {
  SoLoader.loadLibrary(library);
  String soPath = SoLoader.unpackLibraryAndDependencies(library).getAbsolutePath();
  return makeDsoNative(soPath, factory);
}