JNI: Passing multiple parameters in the function signature for GetMethodID
http://stackoverflow.com/questions/7940484/jni-passing-multiple-parameters-in-the-function-signature-for-getmethodid
ASK :
I am trying to execute a function in Java (from C) that has the following signature:
public void execute(int x, int y, int action);
My problem is to define the function signature in GetMethodID:
env->GetMethodID(hostClass, "execute", "(I;I;I;)V");
The problem I ma getting is:
W/dalvikvm( 1849): Bogus method descriptor: (I;I;I;)V
W/dalvikvm( 1849): Bogus method descriptor: (I;I;I;)V
D/dalvikvm( 1849): GetMethodID: method not found: Lcom/device/client/HostConnection;.execute:(I;I;I;)V
I am not sure how to specify the method signature in GetMethodID (for 3 integers as parameters). I saw people use the ";" to separate parameters in other posts for the String and File class, but nothing with primitives like integer.
What would be the correct way to do this please? Thank you.
ANSWER:
According to this file you should use (III)V signature. Only when you need to specify fully qualified class you should use ';', like Ljava/lang/String;.
http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/types.html#wp276
JNI: Passing multiple parameters in the function signature for GetMethodID的更多相关文章
- MyBatis(3.2.3) - Passing multiple input parameters
MyBatis's mapped statements have the parameterType attribute to specify the type of input parameter. ...
- Parameter Passing / Request Parameters in JSF 2.0 (转)
This Blog is a compilation of various methods of passing Request Parameters in JSF (2.0 +) (1) f:vi ...
- [MetaHook] Find a function signature
Find a non-public function signature, we need a tool "IDA Pro" ( You can open picture in a ...
- [Go] Returning Multiple Values from a Function in Go
Returning multiple values from a function is a common idiom in Go, most often used for returning val ...
- [Functional Programming] Function signature
It is really important to understand function signature in functional programming. The the code exam ...
- Can't bind multiple parameters ('header' and 'parameters') to the request's content.
2019-01-23 15:46:29.012+08:00 ERROR [6]: System.InvalidOperationException: Can't bind multiple param ...
- Unity: Passing Constructor Parameters to Resolve
In this tutorial we will go through of couple different ways of using custom constructor parameters ...
- [Angular 2] Pipes with Multiple Parameters
Showing how to set up a Pipe that takes multiple updating inputs for multiple Component sources. imp ...
- [转]JSTL 自定义方法报错Invalid syntax for function signature in TLD.
Apache Tomcat/6.0.18 ${my:splitApply(apply)} <function> <name>splitApply</name> &l ...
随机推荐
- 如何将class文件打包成jar 这里提供两种方式!
原地址:http://blog.163.com/09zzy@126/blog/static/711976652011101001530/ 如何将class文件打包成jar文件,这是一个很严肃的问题,当 ...
- MonoBehaviour的事件和具体功能总结
原地址:http://blog.csdn.net/dingxiaowei2013/article/details/26215577 苦于Visual Studio 2013没有对MonoBehavio ...
- 隐马尔科夫模型 介绍 HMM python代码
#HMM Forward algorithm #input Matrix A,B vector pi import numpy as np A=np.array([[0.5,0.2,0.3],[0.3 ...
- node.js EventEmitter发送和接收事件
EventEmitter是nodejs核心的一部分.很多nodejs对象继承自EventEmitter,用来处理事件,及回调.api文档地址: http://nodejs.org/api/events ...
- allegro飞线隐藏
这些都是最基本的操作,你说的应该是飞线的显示和隐藏,命令在display下面,display>show rats>net(component/all) display>blank r ...
- sockaddr和sockaddr_in的区别(转载)
原文链接:http://kenby.iteye.com/blog/1149001 struct sockaddr和struct sockaddr_in这两个结构体用来处理网络通信的地址. 在各种系统调 ...
- postgreSQL数据类型转换字符串和数值
1.将数值转成字符串类型 方法1:调用to_char(int, text)函数,int为要转换值,text为数值格式化模式,其中模式描述为: 模式 描述 9 带有指定数值位数的值 0 带前导零的值 ...
- SqlServer中decimal(numeric )、float 和 real 数据类型的区别[转]
decimal(numeric ) 同义,用于精确存储数值 float 和 real 不能精确存储数值 decimal 数据类型最 ...
- NopCommerce架构分析之三---数据库初试化及数据操作
系统启动时执行任务:IStartupTask,启动时执行的任务主要是数据库的初始化和加载. IStartupTask调用IEfDataProvider进行数据库的初始化. IEfDataProvide ...
- C# 中的装箱与拆箱
转角撞倒猪 原文 C# 中的装箱与拆箱 装箱:将一个数据项(副本)从栈中自动复制到堆中的行为. int i = 8; object o = i; // 装箱 // 首先在堆中开辟出一片区域,再将 ...