############################################################
LOCAL_STATIC_JAVA_LIBRARIES := my-jar-lib
LOCAL_MODULE_TAGS := eng user
############################################################
LOCAL_STATIC_JAVA_LIBRARIES defines the java library.
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES associates the lib name and jar file (represented by relative path) which is contributed by third party.
The last line means that includes all Android.mk which locate under the current path. In that way, the second Android.mk listed as below is included.
The second Android.mk content :
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PREBUILT_LIBS := YYY.so
include $(BUILD_MULTI_PREBUILT)
The first line is important that announce YYY.so located in the current directory . If you didn't declare LOCAL_PATH (the first line), compiler will go to app/ to find XXX.so instead go to app/libs/ to find due to the second Android.mk is included by the first Android.mk.
=====================================================
上述可以编译通过,但不会将*.so文件打包到.apk中,在第一个mk文件中,加入:
LOCAL_JNI_SHARED_LIBRARIES := YYY