Obtain the domain and method descriptor of NDK development, and develop ndk

Source: Internet
Author: User

Obtain the domain and method descriptor of NDK development, and develop ndk

In the two blogs: calling methods for NDK development and accessing domains for NDK development, we need a parameter called descriptor when obtaining the domain ID and method ID, in actual development, how do we know the descriptor of the domain or method we want to call?

A simple method is to use the javap Command provided by Java.

The Java class file disassembly program in the command line mode provided by JDK is called javap. This tool can extract the domain and method descriptor from the compiled file.

Usage:
On the cmd command line, first go to the main directory of the current project:

Javap operates on compiled Java class files. It has two parameters, indicating the location of the compiled class and the name of the Java class to be decompiled.-p indicates that all classes and members are displayed, -s indicates the output internal type signature. The format is as follows:

Javap-classpath bin/classes-p-s com. example. jni. MainActivity

The javap tool decomassembles the com. example. jni. MainActivty file and signs the output domain or method.

All the fields or method descriptors can be obtained in this simple way.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger. I am very grateful if you have any mistakes.

Related Article

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.