In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article shows you what the principle of JNI and NDK is, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
1. What is JNI?
JNI, starting with Java1.1, the Java Native Interface (JNI) standard becomes part of the java platform, which allows Java code to interact with code written in other languages. JNI was originally designed for native compiled languages, especially C and C++, but it doesn't prevent you from using other languages, as long as the calling convention is supported. Using java to interact with locally compiled code usually loses platform portability. However, in some cases it is acceptable or even necessary to do so. For example, use some old libraries to interact with hardware or operating systems, or to improve the performance of programs. The JNI standard at least ensures that native code can work in any Java virtual machine environment.
two。 What is NDK?
Android NDK adds the word "native" before SDK, that is, Native Development Kit, so it is also called "NDK" by Google.
It is well known that Android programs run in the Dalvik virtual machine, and NDK allows users to execute parts of the program using a native code language like C / C++.
NDK includes:
Tools and build files for generating native code base from C / C++.
Embed a consistent native library in an application package file (application packages files, that is, .apk file) that can be deployed on an Android device.
Some columns of native system headers and libraries that support all future Android platforms
Why use NDK?
Generally speaking, it can be divided into the following situations:
1. Code protection, because the java layer code of apk is easy to be decompiled, but it is more difficult to reverse exchange of Candlestick + library.
two。 Invoke the third-party Cpicket + libraries in NDK, because most open source libraries are written in Cpicurus + code.
3. It is easy to transplant, and the library written in CCompact + can be easily used again on other embedded platforms.
The above is what are the principles of JNI and NDK. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.