Android project import multiple third-party jar packages Android. mk

Source: Internet
Author: User

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>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.