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