如何加载库.so文件到Android应用程序?应用程序、加载、文件、so

2023-09-04 02:52:41 作者:The madman(疯子)

谁能告诉我一个.so文件给我们需要的马蹄莲 JNI 方法的应用程序?该.so文件中包含 C 实施办法。 先谢谢了。

Can anyone tell me with an .so file given we need to calla jni method in app? The .so file contains implementation methods in C. Thanks in advance.

推荐答案

使用code ..

 public class NativeLib {

      static {
        System.loadLibrary("ndk_demo");
      }

      /** 
       * Adds two integers, returning their sum
       */
      public native int add( int v1, int v2 );

      /**
       * Returns Hello World string
       */
      public native String hello();
    }

有关更多信息.. http://marakana.com/forums/android/examples /49.html