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.