Android NDK Practical Learning (iii)-Construction and use of Java End Class objects

Source: Internet
Author: User

1. Before reading this article I assume you have read:

Android NDK Practical Learning-get Java-side classes and their class variables

Android NDK Practical Learning-java End Object member assignment and get object member values

2,java the construction of the End Class object:

① first gets the class;

② gets the parameterless constructor of the class:

" <init> " " () V ");

③ Constructor Class instance:

Jobject Jresult = Env->newobject (Jcsetdatamgr, Initid);

④ assign a value to a class variable:

1     // Assignment assigns a value from C + + to Jresult 2     int 666 ; 3     true ); 4     Env->setintfield (G_testobject, Gs_testgetdatamgr.jidata, i);

Note: Additional assignment codes can refer to the Android NDK utility learning-java End Object member assignment and get object member values

⑤ class instances can be passed as return values and class parameters;

Android NDK Practical Learning (iii)-Construction and use of Java End Class objects

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.