zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    Hibernate实现limit查询报错 :unexpected token: limit near line 1, column 33 [from pojo.Product p order by id limit ?,? ]
    slot_filling
    Perplexity(困惑度)
    图网络
    textrank
    copynet
    PGN
    beam-search的改进
    项目实战:如何构建知识图谱
    实体关系三元组抽取
  • 原文地址:https://www.cnblogs.com/welhzh/p/4181674.html
Copyright © 2011-2022 走看看