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. DJANGO结合jQuery cxSelect 作二级菜单过滤

    EN,到这个阶段,基本功能算是完成了. 使用了jQuery cxSelect这个插件. http://code.ciaoca.com/jquery/cxselect/ 相关代码如下: html: &l ...

  2. Angular.js入门的样例

    感觉这下子,前端的路也宽多了,从容不迫了. 因为可控制的节点又推前了, 有空了好好学一下. 然后结合EXPRESS或METEOR,是不是有点爽? 参考URL: https://toddmotto.co ...

  3. linux下添加PATH环境变量

    添加PATH环境变量,第1种方法:[root@lx_web_s1 ~]# export PATH=/usr/local/webserver/mysql/bin:$PATH 再次查看: [root@lx ...

  4. QT插件开发方式(作者有RemOjbects文档翻译(48)篇)

    创建一个QT的库项目,删除自动生成的.h和.cpp文件,添加一个接口定义.h文件和一个接口实现类(一个.h一个.cpp).代码如下: 1.接口文件源码 #ifndef PLUGININTERFACE_ ...

  5. Android EditText属性

    1.EditText输入的文字为密码形式的设置 (1)通过.xml里设置: 把该EditText设为:android:password="true" // 以”.”形式显示文本 ( ...

  6. tophat输出结果junction.bed

    tophat输出结果junction.bed BED format       BED format provides a flexible way to define the data lines ...

  7. compass和sass很好的两篇文章

    Sass是一种"CSS预处理器",可以让CSS的开发变得简单和可维护.但是,只有搭配Compass,它才能显出真正的威力. 本文介绍Compass的用法.毫不夸张地说,学会了Com ...

  8. centos-nginx添加模块(无需重新编译)

    $ wget http://nginx.org/download/nginx-1.3.2.tar.gz $ .tar.gz #查看ngixn版本极其编译参数 $ /usr/local/nginx/sb ...

  9. SharePoint Designer定制MOSS/WSS表单页面

    转:http://blog.csdn.net/yl_99/article/details/7087897 方法一.使用SharePoint Designer配合enderingTemplate文件来定 ...

  10. Using AngularJS with .NET MVC 5

    This tip shows the use of AngularJS with .NET MVC5 application. Here is a simple step-by-step exampl ...