示例#1
0
  public static void init(final Activity activity) {
    final ApplicationInfo applicationInfo = activity.getApplicationInfo();

    initListener();

    try {
      // Get the lib_name from AndroidManifest.xml metadata
      ActivityInfo ai =
          activity
              .getPackageManager()
              .getActivityInfo(activity.getIntent().getComponent(), PackageManager.GET_META_DATA);
      if (null != ai.metaData) {
        String lib_name = ai.metaData.getString(META_DATA_LIB_NAME);
        if (null != lib_name) {
          System.loadLibrary(lib_name);
        } else {
          System.loadLibrary(DEFAULT_LIB_NAME);
        }
      }
    } catch (PackageManager.NameNotFoundException e) {
      throw new RuntimeException("Error getting activity info", e);
    }

    Cocos2dxHelper.sPackageName = applicationInfo.packageName;
    Cocos2dxHelper.sFileDirectory = activity.getFilesDir().getAbsolutePath();
    // Cocos2dxHelper.nativeSetApkPath(applicationInfo.sourceDir);

    Cocos2dxHelper.sCocos2dMusic = new Cocos2dxMusic(activity);
    Cocos2dxHelper.sCocos2dSound = new Cocos2dxSound(activity);
    Cocos2dxHelper.sAssetManager = activity.getAssets();

    // Cocos2dxHelper.nativeSetAssetManager(sAssetManager);
    Cocos2dxBitmap.setContext(activity);
    sActivity = activity;
  }
示例#2
0
 static {
   // System.loadLibrary("avutil-52");
   // System.loadLibrary("avcodec-55");
   // System.loadLibrary("avformat-55");
   System.loadLibrary("meff");
   System.loadLibrary("tutorial01");
 }
示例#3
0
 static {
   if ("x86".equals(System.getProperty("os.arch"))) {
     System.loadLibrary("NetUsage");
   } else if ("amd64".equals(System.getProperty("os.arch"))) {
     System.loadLibrary("NetUsage_64");
   }
 }
  static {
    System.loadLibrary("gvfs");
    System.loadLibrary("lua");
    System.loadLibrary("gideros");

    System.loadLibrary("storedetector");
  }
示例#5
0
  static {
    Log.i("OF", "static init");

    try {
      Log.i("OF", "loading x86 library");
      System.loadLibrary("OFAndroidApp_x86");
    } catch (Throwable ex) {
      Log.i("OF", "failed x86 loading, trying neon detection", e);

      try {
        System.loadLibrary("neondetection");
        if (hasNeon()) {
          Log.i("OF", "loading neon optimized library");
          System.loadLibrary("OFAndroidApp_neon");
        } else {
          Log.i("OF", "loading not-neon optimized library");
          System.loadLibrary("OFAndroidApp");
        }
      } catch (Throwable e) {
        Log.i("OF", "failed neon detection, loading not-neon library", e);
        System.loadLibrary("OFAndroidApp");
      }
    }
    Log.i("OF", "initializing app");
  }
示例#6
0
文件: Flib.java 项目: rubenmit/hw
 static {
   System.loadLibrary("SDL");
   System.loadLibrary("SDL_net");
   System.setProperty(
       "jna.encoding",
       "UTF8"); // Ugly global setting, but it seems JNA doesn't allow setting this per-library...
 }
 static {
   try {
     System.loadLibrary("voicesearch");
   } catch (UnsatisfiedLinkError localUnsatisfiedLinkError) {
     System.loadLibrary("speech");
   }
 }
示例#8
0
  /** Loads the libgdx native libraries. */
  public static void load() {
    if (disableNativesLoading) {
      System.out.println(
          "So you don't like our native lib loading? Good, you are on your own now. We don't give support from here on out");
      return;
    }
    if (nativesLoaded) return;

    String vm = System.getProperty("java.vm.name");
    if (vm == null || !vm.contains("Dalvik")) {
      if (isWindows) {
        nativesLoaded = loadLibrary("gdx.dll", "gdx-64.dll");
      } else if (isMac) {
        nativesLoaded = loadLibrary("libgdx.dylib", "libgdx.dylib");
      } else if (isLinux) {
        nativesLoaded = loadLibrary("libgdx.so", "libgdx-64.so");
      }
      if (nativesLoaded) return;
    }

    if (!is64Bit || isMac) {
      System.loadLibrary("gdx");
    } else {
      System.loadLibrary("gdx-64");
    }
    nativesLoaded = true;
  }
示例#9
0
  static {
    System.loadLibrary("pngt");
    System.loadLibrary("lept");
    System.loadLibrary("tess");

    nativeClassInit();
  }
示例#10
0
  static {
    /* An alternate library name can be specified via a property. */
    String libname;
    int v_major, v_minor, v_patch;

    v_major = DbConstants.DB_VERSION_MAJOR;
    v_minor = DbConstants.DB_VERSION_MINOR;
    v_patch = DbConstants.DB_VERSION_PATCH;

    if ((libname = System.getProperty("sleepycat.db.libfile")) != null) System.load(libname);
    else if ((libname = System.getProperty("sleepycat.db.libname")) != null)
      System.loadLibrary(libname);
    else {
      String os = System.getProperty("os.name");
      if (os != null && os.startsWith("Windows")) {
        /*
         * On Windows, library name is something like
         * "libdb_java42.dll" or "libdb_java42d.dll".
         */
        libname = "libdb_java" + v_major + v_minor;

        try {
          System.loadLibrary(libname);
        } catch (UnsatisfiedLinkError e) {
          try {
            libname += "d";
            System.loadLibrary(libname);
          } catch (UnsatisfiedLinkError e2) {
            throw e;
          }
        }
      } else {
        /*
         * On UNIX, library name is something like
         * "libdb_java-3.0.so".
         */
        System.loadLibrary("db_java-" + v_major + "." + v_minor);
      }
    }

    initialize();

    if (DbEnv_get_version_major() != v_major
        || DbEnv_get_version_minor() != v_minor
        || DbEnv_get_version_patch() != v_patch)
      throw new RuntimeException(
          "Berkeley DB library version "
              + DbEnv_get_version_major()
              + "."
              + DbEnv_get_version_minor()
              + "."
              + DbEnv_get_version_patch()
              + " doesn't match Java class library version "
              + v_major
              + "."
              + v_minor
              + "."
              + v_patch);
  }
 static {
   try {
     // NativeLibraryLoader.loadLibrary("msmq_native_support");
     System.loadLibrary("msmq_native_support");
   } catch (Exception e) {
     System.loadLibrary("msmq_native_support");
   }
 }
示例#12
0
  // Load the native libraries.
  static {
    // ARToolKit v5.1.0 and later depend on libcurl.
    System.loadLibrary("crypto");
    System.loadLibrary("ssl");
    System.loadLibrary("curl");

    System.loadLibrary("nftBookNative");
  }
示例#13
0
 // Load the .so
 static {
   System.loadLibrary("SDL2");
   System.loadLibrary("SDL2_image");
   // System.loadLibrary("SDL2_mixer");
   // System.loadLibrary("SDL2_net");
   System.loadLibrary("SDL2_ttf");
   System.loadLibrary("main");
 }
  static {
    System.loadLibrary("zlib");
    System.loadLibrary("gvfs");
    System.loadLibrary("lua");
    System.loadLibrary("gideros");

    System.loadLibrary("iab");
  }
 static {
   if (Platform.isSolaris()) {
     System.loadLibrary("nsl");
     System.loadLibrary("socket");
   }
   if (!Platform.isWindows() && !Platform.isWindowsCE()) {
     Native.register("c");
   }
 }
示例#16
0
 static {
   try {
     System.loadLibrary("OpenCVEngine");
     System.loadLibrary("OpenCVEngine_jni");
     mIsReady = true;
   } catch (UnsatisfiedLinkError e) {
     mIsReady = false;
     e.printStackTrace();
   }
 }
  public static void load() {
    if (mLibraryLoaded) return;
    mLibraryLoaded = true;
    //        System.loadLibrary("gnustl_shared");
    System.loadLibrary("x264.142");
    System.loadLibrary("ffmpeg");
    System.loadLibrary("CGE");

    CGEFFmpegNativeLibrary.avRegisterAll();
  }
示例#18
0
 static {
   logger.info("Loading DLL");
   try {
     System.loadLibrary(JINPUT);
     System.loadLibrary(LWJGL);
     System.loadLibrary(OPENAL);
     logger.info("DLL is loaded from memory");
   } catch (UnsatisfiedLinkError e) {
     loadFromJar();
   }
 }
 /* This loads all the ArNetworking classes (they will be in the global
  * namespace) when this class is loaded: */
 static {
   try {
     System.loadLibrary("AriaJava");
     System.loadLibrary("ArNetworkingJava");
   } catch (UnsatisfiedLinkError e) {
     System.err.println(
         "Native code libraries (AriaJava and ArNetworkingJava .so or .DLL) failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n"
             + e);
     System.exit(1);
   }
 }
示例#20
0
  // Used internally to initialize the linker's static data. Assume lock is held.
  private static void ensureInitializedLocked() {
    assert Thread.holdsLock(Linker.class);

    if (!sInitialized) {
      sRelroSharingSupported = false;
      if (NativeLibraries.USE_LINKER) {
        if (DEBUG) Log.i(TAG, "Loading lib" + TAG + ".so");
        try {
          System.loadLibrary(TAG);
        } catch (UnsatisfiedLinkError e) {
          // In a component build, the ".cr" suffix is added to each library name.
          System.loadLibrary(TAG + ".cr");
        }
        sRelroSharingSupported = nativeCanUseSharedRelro();
        if (!sRelroSharingSupported) Log.w(TAG, "This system cannot safely share RELRO sections");
        else {
          if (DEBUG) Log.i(TAG, "This system supports safe shared RELRO sections");
        }

        if (sMemoryDeviceConfig == MEMORY_DEVICE_CONFIG_INIT) {
          sMemoryDeviceConfig =
              SysUtils.isLowEndDevice() ? MEMORY_DEVICE_CONFIG_LOW : MEMORY_DEVICE_CONFIG_NORMAL;
        }

        switch (BROWSER_SHARED_RELRO_CONFIG) {
          case BROWSER_SHARED_RELRO_CONFIG_NEVER:
            sBrowserUsesSharedRelro = false;
            break;
          case BROWSER_SHARED_RELRO_CONFIG_LOW_RAM_ONLY:
            sBrowserUsesSharedRelro = (sMemoryDeviceConfig == MEMORY_DEVICE_CONFIG_LOW);
            if (sBrowserUsesSharedRelro)
              Log.w(TAG, "Low-memory device: shared RELROs used in all processes");
            break;
          case BROWSER_SHARED_RELRO_CONFIG_ALWAYS:
            Log.w(TAG, "Beware: shared RELROs used in all processes!");
            sBrowserUsesSharedRelro = true;
            break;
          default:
            assert false : "Unreached";
            break;
        }
      } else {
        if (DEBUG) Log.i(TAG, "Linker disabled");
      }

      if (!sRelroSharingSupported) {
        // Sanity.
        sBrowserUsesSharedRelro = false;
        sWaitForSharedRelros = false;
      }

      sInitialized = true;
    }
  }
示例#21
0
 static {
   switch (Main.operatingSystem) {
     case 2:
       System.loadLibrary("JIntellitype");
       handler = new JIntellitypeHandler();
       break;
     case 1:
       System.loadLibrary("JXGrabKey");
       handler = new JXGrabKeyHandler();
       break;
   }
 }
示例#22
0
  // --- OpenSSL library initialization --------------------------------------
  static {
    /*
     * If we're compiled as part of Android, should use a different JNI
     * library name. Detect this by looking for the jarjar'd package name.
     */
    if ("com.android.org.conscrypt".equals(NativeCrypto.class.getPackage().getName())) {
      System.loadLibrary("javacrypto");
    } else {
      System.loadLibrary("conscrypt_jni");
    }

    clinit();
  }
示例#23
0
  public static void main(String[] args) throws InterruptedException {
    {
      System.loadLibrary("webp_jni");
      System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
    }
    new ClassPathXmlApplicationContext("classpath*:spring-*.xml").start();
    System.out.println(
        "........................Start image tool....................................");

    synchronized (dubboProvider.class) {
      dubboProvider.class.wait();
    }
  }
  static {
    // FFMPEG (audio/video)
    loadOptionalLibrary("avutil");
    loadOptionalLibrary("swscale");
    loadOptionalLibrary("avcore");

    System.loadLibrary("neon");

    if (!hasNeonInCpuFeatures()) {
      boolean noNeonLibrariesLoaded = loadOptionalLibrary("avcodecnoneon");
      if (!noNeonLibrariesLoaded) {
        loadOptionalLibrary("avcodec");
      }
    } else {
      loadOptionalLibrary("avcodec");
    }

    // OPENSSL (cryptography)
    // lin prefix avoids collision with libs in /system/lib
    loadOptionalLibrary("lincrypto");
    loadOptionalLibrary("linssl");

    // Secure RTP and key negotiation
    loadOptionalLibrary("srtp");
    loadOptionalLibrary("zrtpcpp"); // GPLv3+

    // Tunnel
    loadOptionalLibrary("tunnelclient");

    // g729 A implementation
    loadOptionalLibrary("bcg729");

    // Main library
    if (!hasNeonInCpuFeatures()) {
      try {
        if (!isArmv7() && !Version.isX86()) {
          System.loadLibrary("linphonearmv5");
        } else {
          System.loadLibrary("linphonenoneon");
        }
        Log.w("linphone", "No-neon liblinphone loaded");
      } catch (UnsatisfiedLinkError ule) {
        Log.w("linphone", "Failed to load no-neon liblinphone, loading neon liblinphone");
        System.loadLibrary("linphone");
      }
    } else {
      System.loadLibrary("linphone");
    }

    Version.dumpCapabilities();
  }
示例#25
0
  static {
    // System.out.println(System.getProperty("user.dir"));
    // System.loadLibrary("lib.USB");
    // 加载dll
    try {
      // String path = System.getProperty("user.dir");
      // System.load(path + "\\jnis\\usb_top.dll");
      // System.load(path + "\\jnis\\USB.dll");
      System.loadLibrary("usb_top");
      System.loadLibrary("USB");
    } catch (Error error) {

    }
  }
示例#26
0
  static {
    // For Android version less than 5.0 we need to specific standard library
    // If you have a crash uncomment library that you specific in your Android Builder
    // specification.

    // System.loadLibrary("stlport_shared");
    // System.loadLibrary("gnustl_shared");
    // System.loadLibrary("c++_shared");

    // In this place we are loading native libraries (In revers dependency order).
    // IMPORTANT: Native library always has upp package name!!!
    System.loadLibrary("AndroidMathUtility");
    System.loadLibrary("AndroidMath");
  }
示例#27
0
 // Load library
 static {
   try {
     if (System.getProperty("os.name").startsWith("Win")) {
       // On Windows, load an architecture-specific library
       boolean bits64 = System.getProperty("sun.arch.data.model").contains("64");
       System.loadLibrary("JOMAPI" + (bits64 ? "64" : "32"));
     } else {
       // On other OS's, load a universal library
       System.loadLibrary("JOMAPI");
     }
   } catch (Throwable e) {
     System.err.println("JOMAPI Load Error: " + e.toString());
   }
 }
示例#28
0
 /** Load the necessary libraries in the order of dependency. */
 static {
   System.loadLibrary("opencv_core");
   System.loadLibrary("opencv_imgproc");
   System.loadLibrary("opencv_highgui");
   System.loadLibrary("opencv_flann");
   System.loadLibrary("opencv_features2d");
   System.loadLibrary("opencv_calib3d");
   System.loadLibrary("opencv_video");
   System.loadLibrary("chilitags");
   System.loadLibrary("chilitags_jni_bindings");
 }
示例#29
0
 static {
   System.loadLibrary("mp3lame");
   System.loadLibrary("avutil-54");
   System.loadLibrary("avcodec-56");
   System.loadLibrary("avfilter-5");
   System.loadLibrary("avformat-56");
   System.loadLibrary("swresample-1");
   System.loadLibrary("swscale-3");
   System.loadLibrary("gnustl_shared");
   System.loadLibrary("codecs");
 }
示例#30
0
 static {
   try {
     System.loadLibrary("neondetection");
     if (hasNeon()) {
       Log.i("OF", "loading neon optimized library");
       System.loadLibrary("OFAndroidApp_neon");
     } else {
       Log.i("OF", "loading not-neon optimized library");
       System.loadLibrary("OFAndroidApp");
     }
   } catch (Throwable e) {
     Log.i("OF", "failed neon detection, loading not-neon library", e);
     System.loadLibrary("OFAndroidApp");
   }
 }