Example of Android. mk compiling APK

Source: Internet
Author: User
The following is only an example of using Android. mk to compile the APK program. For more information about Android. mk, see 《 About Android. mk1. Compile a simple APK local_path :=$ (call my-DIR) include $ (clear_vars) # build all java files in the Java subdirectory local_src_files: = $ (call all-subdir-Java-files) # name of the apk to build local_package_name: = localpackage # Tell it to build an APK include $ (build_package) 2. Compile a dependency static. APK local_path: = $ (call my-DIR) include $ (clear_vars) # list of static libraries to include in the package Lo Cal_static_java_libraries: = static-library # build all java files in the Java subdirectory local_src_files: =$ (call all-subdir-Java-files) # name of the apk to build local_package_name: = localpackage # Tell it to build an APK include $ (build_package) Note: local_static_java_libraries should be followed by the JAR File Name of the Java library required by your APK program. 3. Compile an APK local_path :=$ (call my-DIR) include $ (clear_vars) # build all java files in the Java subdirectory local_src_files: = $ (call all-subdir-Java-files) # name of the apk to build local_package_name: = localpackage local_certificate: = platform # Tell it to build an APK include $ (build_package) note: local_certificate should be followed by the file name of the signature file. 4. Compile an APK local_path :=$ (call my -DIR) include $ (clear_vars) # build all java files in the Java subdirectory local_src_files: = $ (call all-subdir-Java-files) # name of the apk to build local_package_name: = localpackage local_certificate: = vendor/example/certs/APP # Tell it to build an APK include $ (build_package) 5. Load a common third-party APK local_path: = $ (call my-DIR) include $ (clear_vars) # Module name shocould match APK name to be installe D. local_module: = localmodulename local_src_files: = $(local_module).apk local_module_class: = apps local_module_suffix: = $ (optional) local_certificate: = platform include $ (build_prebuilt) 6. Loading required. so (dynamic library) third-party apklocal_path: = $ (my-DIR) include $ (clear_vars) local_module: = runtime (local_module).apk local_module_class: = appslocal_module _ Suffix: = $ (common_android_package_suffix) local_certificate: = platforminclude $ (build_prebuilt) ######################################## ############################### copy the library to/system/lib ######################################## ######################################## ######### include $ (clear_vars) local_module: = libinputcore. solocal_module_class: = shared_librarieslocal_module_path: = $ (Target_out_shared_libraries) local_src_files: = lib/$ (local_module) override_build_module_path: = $ (Inline) include $ (build_prebuilt) 7. Compile a static Java library local_path: = $ (call my-DIR) include $ (clear_vars) # build all java files in the Java subdirectory local_src_files :=$ (call all-subdir-Java-files) # Any libraries that this library depends on local_java_libraries: = android. Test. runner # The Name Of The JAR file to create local_module: = sample # Build a static JAR file. include $ (build_static_java_library) Note: local_java_libraries indicates the JAR File Name of the generated Java library. Article transferred from: http://blog.csdn.net/hudashi/article/details/7059012
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.