The system.loadlibrary () execution process in Android Java __java

Source: Internet
Author: User

First app, after system


http://my.oschina.net/wolfcs/blog/129696


directory [-] System library path Native Layer Load library process

System.loadlibrary () is a very important function that we use when using Java's JNI mechanism, which is to bring in the libraryload that implements the native method that we declare in Java code. or load other dynamic connection libraries.

Be curious, we can look at this method of its implementation, that is, the implementation process. (The code that is analyzed below comes from the Android 4.2.2 Aosp version.) First look at the code for this method (in the Libcore/luni/src/main/java/java/lang/system.java file):?

1 2 3 4 5 6 7 8 9 /**   * Loads and links the library wi Th the specified name. The mapping of the   * specified library name to the ' full path ' for loading the ' library is   * IMPLEMENTATION-DEP Endent.   *   * @param libname   *            the name of T He library to load.   * @throws unsatisfiedlinkerror   *              If the library could no<span style= "color: #003399;" ></span>t be loaded.  
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.