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.