Http://hi.baidu.com/ivychunmiao/blog/item/13832c0b31a03d366159f32e.html
Sometimes a third-party jar package needs to be referenced in an application. How can this jar package be introduced during app compilation?
Add the following statement to the Android. mk file of the APP:
------------------------------ Start -----------------------------------------------
Local_path: = $ (call my-DIR)
Include $ (clear_vars)
Local_module_tags: = user Eng
########################################
Local_static_java_libraries: = lib3party // define the reference name
########################################
....
Include $ (build_package)
######################################## #######################
Include $ (clear_vars)
Local_prebuilt_static_java_libraries: = lib3part: libs/3part. Jar // reference name: jar package name
Include $ (build_multi_prebuilt)
######################################## ########################
-------------------------------- End ----------------------------------------------------------------
The above red font is the statement for adding a jar package. The key lies in local_static_java_libraries: = libarity and local_prebuilt_static_java_libraries: = libarity: Lily. jar.
Libarity is the alias of the jar package and can be taken as long as it corresponds to the following. However, the name of the jar package after the colon must be the name of the jar package you want to introduce. The jar package should be in the root directory of the project, that is, the directory at the same level as the SRC, res, and Android. mk files of the app you want to compile.
Note that multiple jar files cannot be written in this http://blog.csdn.net/fangchongbory/article/details/7592889.
<Span xmlns = "http://www.w3.org/1999/xhtml" style = ""> local_path: = $ (call my-DIR) include $ (clear_vars) local_module_tags: = optional # libname can be set by yourself. Note the changes here !! Added runtime: = libname \ libname2local_src_files :=$ (call all-Java-files-under, Src) local_package_name: = runtime: = platforminclude $ (build_package) include $ (clear_vars) local_module_tags: = optional # libname must be the same as the name defined above, needimport. jar is the third-party jar package you need to import. note the changes here !! # Libname2: lib/needimport2.jarlocal _ prebuilt_static_java_libraries: = libname: lib/needimport. Jar \ libname2: lib/needimport2.jarinclude $ (build_multi_prebuilt) </span>