The JNI concept of the Android (Java) Learning Note 255:jni

Source: Internet
Author: User

1. What is JNI?

Java Native Interface (Java Native Interface)

For example, method declaration:

Public final native class<?> getclass (from source Object.java)

The method above does not have a method body, but it is not an abstract method, it is a concrete method, because it adds native modification, which means that this method is implemented using the underlying C.

Java provides JNI as an interface specification that can be used to invoke functional modules written in other programming languages (needless to do with Java re-development), can call C + +, or VB, and so on.

2. Why use JNI?

(1) Demand (money)

(2) high-performance (high efficiency for C + + )

(3) Construction of the Internet of Things

(4) C Open Source components (c open source components are rich, using JNI to invoke these C open source components)

3. How to learn JNI?

(1) Java basics

Linux system because of open source, performance is very perfect and stable, and the virus is very few, so the Linux system is often used as a server system ( fancy Linux security, stability )

(2) C Language Foundation

(3) JNI role

JNI is a protocol specification (similar to the JVM, JNI is also the role of the translator), the C code through the JNI protocol specification, translate it into the corresponding Java code, the logical diagram is as follows:

The JNI concept of the Android (Java) Learning Note 255:jni

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.