jni nomemclature

Discussion in 'Java' started by bob smith, Mar 8, 2013.

  1. bob smith

    bob smith Guest

    When using JNI, how do you know if the package name will appear in the C method name?

    For instance, if you have a method named save() in class Canvas in package android.graphics, which is the correct JNI name?

    Java_android_graphics_Canvas_save

    or

    Java_Canvas_save

    ?

    Thanks.
    bob smith, Mar 8, 2013
    #1
    1. Advertising

  2. bob smith

    Arne Vajhøj Guest

    On 3/8/2013 4:38 PM, bob smith wrote:
    > When using JNI, how do you know if the package name will appear in the C method name?
    >
    > For instance, if you have a method named save() in class Canvas in package android.graphics, which is the correct JNI name?
    >
    > Java_android_graphics_Canvas_save
    >
    > or
    >
    > Java_Canvas_save
    >
    > ?


    Typical you generate the header file and see the name there.

    But the package name is used.

    It is documented here:

    http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/design.html#wp615

    Arne
    Arne Vajhøj, Mar 8, 2013
    #2
    1. Advertising

  3. bob smith

    Roedy Green Guest

    On Fri, 8 Mar 2013 13:38:53 -0800 (PST), bob smith
    <> wrote, quoted or indirectly quoted someone
    who said :

    >For instance, if you have a method named save() in class Canvas in package android.graphics, which is the correct JNI name?


    you run javah and have a look at the C names it generates.

    see http://mindprod.com/jgloss/jni.html
    --
    Roedy Green Canadian Mind Products http://mindprod.com
    Software gets slower faster than hardware gets faster.
    ~ Niklaus Wirth (born: 1934-02-15 age: 79) Wirth’s Law
    Roedy Green, Mar 8, 2013
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Hunsley

    IBM's JNI fails where Sun's JNI works

    Alex Hunsley, Nov 3, 2003, in forum: Java
    Replies:
    4
    Views:
    848
    Alex Hunsley
    Nov 4, 2003
  2. Pasturel Jean-Louis

    Porting JNI Windows under JNI LINUX + Wine ?

    Pasturel Jean-Louis, Feb 29, 2004, in forum: Java
    Replies:
    5
    Views:
    904
    Pasturel Jean-Louis
    Mar 3, 2004
  3. vasanth
    Replies:
    0
    Views:
    2,687
    vasanth
    Jan 25, 2005
  4. vasanth
    Replies:
    0
    Views:
    620
    vasanth
    Jan 25, 2005
  5. bgabrhelik
    Replies:
    0
    Views:
    803
    bgabrhelik
    Sep 29, 2009
Loading...

Share This Page