본문 바로가기

Android

shared object 사용하기

반응형

linux shared object 생성하기

arm-none-linux-gnueabi-gcc -l/usr/lib/jvm/java-6-sun/include -l/usr/lib/jvm/java-6-sun/include/linux -fpic -c test_nativeTest.c

arm-none-linux-gnueabi-ld -T armelf_linux_eabi.xsc -shared -o test_nativeTest.so test_nativeTest.o


java code에서 so를 호출한다.
class a{
static{
system.load(/data/com_test_nativeTest.so);
}
}



생성한 so 를 adb push test_nativeTest /data/ 명령을 이용하여 emulator에 전송한다.

eclipse를 통하여 어플리케이션을 전송한다.