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. 【leetcode】Word Break II (hard)★

    Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each ...

  2. hdu 4454 Stealing a Cake 三分法

    很容易想到三分法求解,不过要分别在0-pi,pi-2pi进行三分. 另外也可以直接暴力枚举…… 代码如下: #include<iostream> #include<stdio.h&g ...

  3. 并发下常见的加锁及锁的PHP具体实现

    http://www.cnblogs.com/scotoma/archive/2010/09/26/1836312.html Apache + PHP 的并发访问 http://www.cnblogs ...

  4. java jdk自带程序分析(内存分析/线程分析)

    周末看到一个用jstack查看死锁的例子.昨天晚上总结了一下jstack(查看线程).jmap(查看内存)和jstat(性能分析)命令. 1.1.Jstack 1.1   jstack能得到运行jav ...

  5. javascript高级程序设计读书笔记

    第2章  在html中使用javascript 一般都会把js引用文件放在</body>前面,而不是放在<head>里, 目的是最后读取js文件以提高网页载入速度. 引用js文 ...

  6. innodb 间隙锁

    innodb 间隙锁, 参考 MySQLInnoDB锁机制(二) 针对于辅助索引,也称范围索引 间隙锁只会出现在辅助索引上,唯一索引和主键索引是没有间隙锁.间隙锁(无论是S还是X)只会阻塞insert ...

  7. Rman实现数据库迁移

    Rman实现数据库迁移(从库A迁移到库B)环境:服务器A:Oracle10g+AS3服务器B:Oracle10g+AS4准备工作: 1 在数据库B上建立与库A相同的目录结构(若由于磁盘空间等原因可以用 ...

  8. (三)学习MVC之密码加密及用户登录

    1.密码加密采用SHA256 算法,此类的唯一实现是 SHA256Managed.在Common/Text.cs里添加Sha256方法: public static string Sha256(str ...

  9. Js获取Cookie值的方法

    function getCookie(name) { var prefix = name + "=" var start = document.cookie.indexOf(pre ...

  10. stm32 DAC输出音频

    #define DAC_DHR8R1_Address 0x40007410 // Init Structure definition DAC_InitTypeDef DAC_InitStructure ...