According the article "Android - Invoke JNI based methods (Bridging C/C
++ and Java)", I change the steps of building library
first, copy and modify the linker script armelf_linux_eabi.xsc by the
article,
second, build library as follows:
arm-none-linux-gnueabi-gcc -I/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/
include/linux/ -I/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/include -fpic -c
project_testjni_TestJNI.c
arm-none-linux-gnueabi-ld -T armelf_linux_eabi.xsc -shared -o
libNativeAdd.so project_testjni_TestJNI.o
But while running loadLibrary("libNativeAdd"), the same as before, it
throw a "UnsatisfiedLinkError" exception.
I search keyword "JNI" & "Android" , most of archives are useless...
BTW, We must install strace, busybox in our emulator and copy system
image to PC? I havn't install it right now.
On 4月8日, 下午5时57分, David Given <[EMAIL PROTECTED]> wrote:
> Macro wrote:
> > I compile the c file as library with arm-none-linux-gnueabi-gcc,
> > then put the so file in emulator's directory :"/system/lib",
> > while execute System.loadLibrary, there is a dialog said :"Library not
> > found".
>
> Building JNI libraries is strange and complicated --- you need a custom
> linker script to make it work. Check out this page:
>
> http://davanum.wordpress.com/2007/12/09/android-invoke-jni-based-meth...
>
> You may also want to search the archives for JNI, as a number of us have
> been trying this for a while...
>
> --
> David Given
> [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---