[Excerpt] APK compilation example for Android. mk

Source: Internet
Author: User
Only Android. mk is used to compile the APK. Program . For more information about Android. mk, see 《 Android. mk " I, Compile 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) II, Compile APK dependent on the static. JAR File Local_path: = $ (call my-DIR) include $ (clear_vars) # list of static libraries to include in the package local_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. III, Compile APK signed by platform key 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 The file name of the signature file should be followed. IV, Compile APK with special vendor Key signature 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) V, Load one Common third-party APK Local_path: = $ (call my-DIR) include $ (clear_vars) # Module name shocould match APK name to be installed. local_module: = localmodulename local_src_files: = program (local_moduleapps.apk local_module_class: = apps local_module_suffix: = $ (optional) local_certificate: = platform include $ (build_prebuilt) VI, Load Third-party APK that requires. So (dynamic library) Local_path: = $ (my-DIR) include $ (clear_vars) local_module: = partition: = export local_module_class: = partition: = $ (partition) local_certificate: = platforminclude $ (build_prebuilt) ######################################## ############################### copy the library to/system/lib ######################################## ######################################## ######### include $ (clear_vars) local_module: = libinputcore. solocal_module_class: = libraries :=$ (target_out_shared_libraries) local_src_files: = lib/$ (local_module) override_build_module_path :=$ (modules) 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.

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.