Learning Journey Based on Android NDK ----- JNI Data Type

Source: Internet
Author: User

The classic old-fashioned process, learning programming language, first learning its most basic data type, as does JNI. JNI defines a series of basic data types and reference data types that correspond to java.
 
1. Basic Data Types
The following table describes the space occupied by the relationship between the basic data types in Java and the basic data types in JNI.

As you can see, it is actually the basic data type. The basic data type of JNI is only 'J' more than the basic data type of Java.
Of course, there is a jsize not in Java in JNI, which is defined as follows:
Typedef jint jsize;
In fact, the jsize integer is used to describe basic metrics and sizes, and there is no mystery.

2. Reference Data Type
The relationship between the JNI reference type and Java is shown in the following tree Hierarchy Diagram:

 
Like java, jobject is the father of all reference types. Is it easy to understand? Haha. For jthrowable, JNI also has the thread concept.
3. The jvalue Type
Jvalue is a set of basic and referenced data types. Its definition is as follows:
Typedef union jvalue {
Jboolean z;
Jbyte B;
Jchar c;
Jshort s;
Jint I;
Jlong j;
Jfloat f;
Jdouble d;
Jobject l;
} Jvalue;
 
 
 

 
This article is from the "Duicky" blog

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.