Android source code compilation jar Package Build_java_library and build_static_java_library difference

Source: Internet
Author: User

Typically, a typical makefile (ANDROID.MK) that compiles a jar package under Android Source code is as follows:

Add the following to the file:

Local_path:= $ (call My-dir)
#make jar
Include $ (clear_vars)
Local_src_files: = $ (call all-subdir-java-files)
Local_module: = Mytestjar
Include $ (build_java_library)

#include $ (build_static_java_library)

So, what is the difference between build_java_library and build_static_java_library?

Simply put, the jar package is actually a zip-format package, then:

1. Build_java_library compiled jar package, which is the DEX format file, if the user wants to use this jar to put into eclipse to do Android app development, Eclipse is not aware of this format of files, Usually error: Conversion to Dalvik format failed with error 1;

2. While the build_static_java_library compiled jar package, each Java file corresponding to the class file exists separately, as the name implies, each Java file used in the variables are statically compiled into the class inside, The jar package in this format can be imported and used normally in eclipse, but there may be some compatibility problems, this is discussed separately.

Android source code compilation jar Package Build_java_library and build_static_java_library difference

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.