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的更多相关文章

  1. MyBatis(3.2.3) - Passing multiple input parameters

    MyBatis's mapped statements have the parameterType attribute to specify the type of input parameter. ...

  2. 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 ...

  3. [MetaHook] Find a function signature

    Find a non-public function signature, we need a tool "IDA Pro" ( You can open picture in a ...

  4. [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 ...

  5. [Functional Programming] Function signature

    It is really important to understand function signature in functional programming. The the code exam ...

  6. 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 ...

  7. Unity: Passing Constructor Parameters to Resolve

    In this tutorial we will go through of couple different ways of using custom constructor parameters ...

  8. [Angular 2] Pipes with Multiple Parameters

    Showing how to set up a Pipe that takes multiple updating inputs for multiple Component sources. imp ...

  9. [转]JSTL 自定义方法报错Invalid syntax for function signature in TLD.

    Apache Tomcat/6.0.18 ${my:splitApply(apply)} <function> <name>splitApply</name> &l ...

随机推荐

  1. 2013流行Python项目汇总

    2013流行Python项目汇总 转自:http://www.kankanews.com/ICkengine/archives/102963.shtml Python作为程序员的宠儿,越来越得到人们的 ...

  2. HDU1429+bfs+状态压缩

    bfs+状态压缩思路:用2进制表示每个钥匙是否已经被找到.. /* bfs+状态压缩 思路:用2进制表示每个钥匙是否已经被找到. */ #include<algorithm> #inclu ...

  3. Foreman--Puppet类导入

    一.Foreman环境: foreman建好后,系统默认创建了3个环境:production,development,common, 1. production: 在puppet.conf里已经定义其 ...

  4. 2.2linux内核移植简介

    1,编译linux3.5出错 root@phone-desktop:/opt/FriendlyARM/tiny4412/Linux/linux-3.5# makescripts/kconfig/con ...

  5. 25.allegro中模块复用[原创]

    一,Module reuse 1,打开原理图 ------------------- --------------------- ctrl+i过滤器 直选part ctrl+e 查看属性 查看: 是否 ...

  6. JavaScript DOM高级程序设计1.3-常见陷阱--我要坚持到底!

    区分大小写 单引号双引号 大多数开发人员选择用单引号,因为XTHML要求所有XHTML的属性都必须使用双引号 var html='<h2 class="a">A lis ...

  7. XSLT 处理程序是如何工作的

    与 JSP.PHP 和其他 Web 开发语言的比较 在本文中,Benoit Marchal 考察了 XSLT 处理程序的工作原理.为了说明他的观点,他编写了专门的样式表把处理中的某些方面凸显出来.他特 ...

  8. 【HDOJ】4328 Cut the cake

    将原问题转化为求完全由1组成的最大子矩阵.挺经典的通过dp将n^3转化为n^2. /* 4328 */ #include <iostream> #include <sstream&g ...

  9. Factorial

    Factorial  计算阶乘 In mathematics, the factorial of a non-negative integer n, denoted by n!, is the pro ...

  10. Glimpse

    给自己程序配好Glimpse. Glimpse.Mvc 有问题 遇到稍微复杂点的内套多个PartialView,内存就爆了彪1.7g,不开Glimpse一点问题都没.另外Glimpse.Nlog也有问 ...