so into apk

1. use given .so
a. make lib dir under the app's dir
b.copy your libXX.so into the dir.
c.modify the Android.mk
add "COCAL_JNI_SHARED_LIBRARIES :=libXX" 

  1. LOCAL_PATH:= $(call my-dir)  
  2. include $(CLEAR_VARS)  
  3. LOCAL_MODULE_TAGS := optional  
  4. LOCAL_SRC_FILES := $(call all-java-files-under, src)  
  5. LOCAL_PACKAGE_NAME := Mms  
  6. # Builds against the public SDK  
  7. #LOCAL_SDK_VERSION := current  
  8. LOCAL_STATIC_JAVA_LIBRARIES += android-common jsr305  
  9. LOCAL_REQUIRED_MODULES := SoundRecorder  
  10. LOCAL_PROGUARD_FLAG_FILES := proguard.flags  
  11.   
  12. LOCAL_JNI_SHARED_LIBRARIES := libelfylin  
  13.   
  14. include $(BUILD_PACKAGE)  
  15. # This finds and builds the test apk as well, so a single make does both.  
  16. include $(call all-makefiles-under,$(LOCAL_PATH))  

2.use give .so

a.don't modify Android.mk

make"libs/armeabi" under app's directory.

b.copy libXX.so into the directory

(not try yet)

 

3.with c source code

a.build your source directory, just as other lib files in external directory.

b. copy it to any of your app's subdirectory

c. modify "Android.mk"

add add "COCAL_JNI_SHARED_LIBRARIES :=libXX" 

 

http://www.2cto.com/kf/201108/101114.html

posted @ 2012-04-06 21:56  cascais  阅读(236)  评论(0编辑  收藏  举报