Profile

Cover photo
Arpi Vezer
Works at SwiftKey
Lived in London
51 followers|199,293 views
AboutPostsPhotosVideos

Stream

Arpi Vezer

Shared publicly  - 
 
 
+Raoul-Gabriel Urma  +Jim Gough  and I have teamed up to produce a #Java 8 & #Lambdas training course:

http://java8training.com

(Please +1)
1
Add a comment...

Arpi Vezer

Shared publicly  - 
 
Free Caltech online machine learning course starts again on 2 April http://work.caltech.edu/telecourse. I really enjoyed the course, worth checking out if you're interested in the subject.
1
Add a comment...

Arpi Vezer

Shared publicly  - 
 
Hope Google Now soon learns that while my office overlooks a bus stop, I don't need to be kept informed of its timetable
London
1
Add a comment...

Arpi Vezer

Shared publicly  - 
 
The new stream in g+ for android looks awesome!
London
1
Add a comment...

Arpi Vezer

Shared publicly  - 
 
My new calendar, with a different font for every day. I'm cool.
1
Add a comment...

Arpi Vezer

Shared publicly  - 
 
now for 6 awesome hrs of Tour de France!
1
Add a comment...

Arpi Vezer

Shared publicly  - 
 
The people that edit the Apprentice are comedy geniuses
1
Add a comment...
Have him in circles
51 people
Olek Gajowniczek's profile photo
Paul Butcher's profile photo
Tracy Harvey's profile photo
Ying-Chu Chen's profile photo
Jonathan Bailey's profile photo
Arpad Vezer's profile photo
Sam Wheatley's profile photo
James Withers's profile photo
Tom Dean's profile photo

Arpi Vezer

Shared publicly  - 
 
JNI Overloaded Method Signatures

tl;dr Avoid them! :)

I've never really written any JNI code before, so here are some quick notes on potential gotchas that lead to an UnsatisfiedLinkError when exposing overloaded C++ functions to Java classes.

Overview

Overloaded method names are appended with a double underscore "__" followed by the Java method signature, so for a java.lang.String this would be Ljava_lang_String_2, or Lyour_namespace_Classname_2 for an arbitrary object. multiple arguments are appended to the name without any separator, so the "L..." follows immediately after the "..._2".

The signature convention is detailed here: http://docs.oracle.com/javase/6/docs/technotes/guides/jni/spec/design.html

Note the bits about escaping underscores with "_1" if you have them in any names, like in the example_namespace below. Also important to keep in mind is that mangling is in the JNI sense of the word, not C++ symbol mangling!

Here's a simple, hopefully correct example.

C++ class to wrap

//foo.hpp
namespace example_namespace {
class ArgA;
class ArgB;

class Foo {
  //...
  void func(const ArgA &a);
  void func(const ArgA &a, const ArgB &b);
};
}

Java counterpart
//Foo.java
package example_namespace;
public class Foo {
  //...
  public native func(ArgA a);
  public native func(ArgA a, ArgB b);
}

JNI wrapper
(I'm not sure of the correct terminology for these wrapping layers.)

//example_namespace_Foo.cpp
JNIEXPORT void JNICALL
Java_example_1namespace_Foo_func_Lexample_1namespace_ArgA_2(JNIEnv* env, jobject obj, jobject a) { /* ... */ }
Java_example_1namespace_Foo_func_Lexample_1namespace_ArgA_2Lexample_1namespace_ArgB_2(JNIEnv* env, jobject obj, jobject a, jobject b) { /* ... */ }
1
Add a comment...

Arpi Vezer

Shared publicly  - 
 
The best dynamic memory/cheese metaphors I've seen all week
1
Add a comment...

Arpi Vezer

Shared publicly  - 
 
The Nokia 808 camera in this video looks great. I wonder how much the footage was improved during post production.
London
1
Add a comment...

Arpi Vezer

Shared publicly  - 
 
Thanks Apple, now it feels wrong no matter which way I set the scrolling on my laptop
1
Add a comment...

Arpi Vezer

Shared publicly  - 
1
Add a comment...
People
Have him in circles
51 people
Olek Gajowniczek's profile photo
Paul Butcher's profile photo
Tracy Harvey's profile photo
Ying-Chu Chen's profile photo
Jonathan Bailey's profile photo
Arpad Vezer's profile photo
Sam Wheatley's profile photo
James Withers's profile photo
Tom Dean's profile photo
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Previously
London
Links
YouTube
Work
Employment
  • SwiftKey
    Software Engineer, 2013 - present
Basic Information
Gender
Male