[Excerpt] Android. mk adds a third-party jar or so Library to the apk.

Source: Internet
Author: User

I,CompileSimple APKLOCAL_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,CompileAPK dependent on the static. jar FileLOCAL_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,CompileAPK signed by platform keyLOCAL_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 Name of the signature fileIV,CompileAPK with special vendor key signatureLOCAL_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 oneCommon third-party APKLOCAL_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,LoadThird-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 LibraryLOCAL_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.

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.