Android imports multiple third-party jar packages

Source: Internet
Author: User

 

I encountered a problem today. I need to import two third-party jar packages under the project directory.

As you all know, to import a jar package in eclipse, right-click the project directory, select Add library, select the directory where the jar package is located, and then import it. But how do I import an application compiled under the package/APP/source code directory?

Actually, the implementation is quite simple. You need to modify the Android. mk file.

 

The Code is as follows:

 

Local_path: = $ (call my-DIR) include $ (clear_vars) local_module_tags: = optional # libname can be set by yourself local_static_java_libraries: = libname local_src_files: = $ (call all-Java-files-under, Src) local_package_name: = englishlearnlocal_certificate: = 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 local_prebuilt_static_java_libraries: = libname: lib/needimport. jarinclude $ (build_multi_prebuilt)


I encountered a problem today. I need to import multiple jar packages. How can I write the Android. mk file.

I tried several methods and couldn't compile them. After thinking about it, it should be related to the makefile programming syntax. below is the Android. mk compiled successfully.

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 !! # Added libname2: lib/needimport2.jarlocal _ prebuilt_static_java_libraries: = libname: lib/needimport. Jar \ libname2: lib/needimport2.jarinclude $ (build_multi_prebuilt)


 

To add multiple third-party jar packages, you only need to enter a space in the original value assignment statement, add the "\" character, and then add the package to be imported in the second line.

 

 

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.