facebookincubator / fbjni

A library designed to simplify the usage of the Java Native Interface
Apache License 2.0
266 stars 47 forks source link

Is there any example for creating a Hybrid class? #57

Closed psionic12 closed 3 years ago

psionic12 commented 3 years ago

As I understand about the Hybrid (correct me if I'm wrong), it is a glue to bind an C++ object to a Java object, and is useful to handle C++ lifetime.

But I didn't find any docs about how to use them, so is there any examples?

barthap commented 3 years ago

Hi, you can look at the code of react-native-reanimated - it's using hybrid classes extensively.

psionic12 commented 3 years ago

I wrote a example demo on how to import and use fbjni, hope it can help others. https://github.com/psionic12/fbjni_demo