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
To call a Java method from C++, you currently must do quite a lot. As an example, consider
Number::floatValue. You must:class Floatwith aNamemethod returning"java/lang/Float"jni::Class<Float>GetMethod<jni::jfloat ()>(env, "floatValue")on itObject<Number>instance, donumber.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