MECOP: Android phone memory management and performance optimization

Source: Internet
Author: User

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6B/72/wKioL1UuELfRagIBAAC5nAztIP4911.jpg "title=" 1.jpg " alt= "Wkiol1uuelfragibaac5naztip4911.jpg"/>



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 initially designed for local compiled languages, especially C and C + +, but it does not prevent you from using other languages, as long as the calling convention is supported. Using Java to interact with locally compiled code often loses platform portability. However, in some cases it is acceptable and even necessary. For example, use some old libraries to interact with the hardware, the operating system, or to improve the performance of the program. The JNI standard ensures that the local code can work in any Java Virtual machine environment at least.

2. What is the NDK

The Android NDK was added in front of the SDK with the word "native", the native development Kit, which Google called the "NDK".

As is known to all, Android programs run in Dalvik virtual machines, and the NDK allows users to execute part of the program using native code languages like C + +.

The NDK includes:

The tools and build files required to generate the native code base from C + +.

Embed a consistent native library into the application package files that you can deploy on your Android device (application packages files, the. apk file).

Support for all future Android platforms with some column native system header files and libraries

Why use the NDK?

Broadly speaking, it is mainly divided into the following situations:

1. Protection of the code, because the Java layer Code of the APK is easy to decompile, and the C + + library is difficult to reverse the sink.

2. Call the third-party C/S library in the NDK, because most of the open source libraries are written in C/s code.

3. Easy to transplant, the library written in C + + can be reused on other embedded platforms.


Links: Http://pan.baidu.com/s/1c0GpNVU  

Password: 299v

This article is from the "9343141" blog, please be sure to keep this source http://9353141.blog.51cto.com/9343141/1632958

MECOP: Android phone memory management and performance optimization

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.