If the building process is from android source tree, the Android.mk needs to be written. So, how to pack 3rd-party shared library .jar/.so into apk by Android.mk?
For .jar
# the name is just a name, it will map to real .jar later LOCAL_STATIC_JAVA_LIBRARIES := refJar1 \ refJar2 # here maps to actual .jar location LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := refJar1 :libs/oooo.jar\ refJar2 :libs/xxxx.jarFor .so
# Put .so to out/target/product/***/obj/lib $(shell cp $(wildcard $(LOCAL_PATH)/libs/armeabi/*.so) $(TARGET_OUT_INTERMEDIATE_LIBRARIES)) LOCAL_JNI_SHARED_LIBRARIES := libs/libxxxx
References
- 在apk裡打包進.so文件的方法: http://blog.csdn.net/androidboy365/article/details/6772890
- Android build system分析: http://blog.csdn.net/ccskyer/article/details/6122963
- android 內置app編譯方法及Android.mk中的系統變量說明: http://bbs.ancode.org/forum.php?mod=viewthread&tid=86
- Android NDK開發指南---Android.mk文件: http://hualang.iteye.com/blog/1140414
- Android Application, Android Libraries and Jar Libraries: http://devmaze.wordpress.com/2011/05/22/android-application-android-libraries-and-jar-libraries/
No comments:
Post a Comment