Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ergonomics of calling Java from C++ #11

Open
jfirebaugh opened this issue Apr 24, 2017 · 0 comments
Open

Improve ergonomics of calling Java from C++ #11

jfirebaugh opened this issue Apr 24, 2017 · 0 comments

Comments

@jfirebaugh
Copy link
Contributor

jfirebaugh commented Apr 24, 2017

To call a Java method from C++, you currently must do quite a lot. As an example, consider Number::floatValue. You must:

  • Define class Float with a Name method returning "java/lang/Float"
  • Declare and initialize a jni::Class<Float>
  • Call GetMethod<jni::jfloat ()>(env, "floatValue") on it
  • Once you have an Object<Number> instance, do number.Call(env, method)

Ideally, you'd be able to just do number.floatValue(). Is there any way we can get closer to that?

Refs mapbox/mapbox-gl-native#8809

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant