-
Notifications
You must be signed in to change notification settings - Fork 255
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
High level C++ bindings for JNI calls #1314
Comments
https://android.googlesource.com/platform/libnativehelper/ is the one we use in AOSP, so most likely path is to use that. Will definitely have a look at the others to see what we're missing, if anything. |
@pjmlp could you share the Reddit? |
From the AMA last week: https://www.reddit.com/r/androiddev/comments/hk3hrq/_/fxkkk6l |
@mgood7123 what is |
ummm just ignore that |
https://github.com/wang-bin/JMI I use it in my projects. The api is simple to use. |
If useful (and since not mentioned here), after reviewing the available options, we found fbjni to be quite good for the Android JNI use case, with helper code on both sides of the language boundary. It's already widely used and tested in, e.g. React Native and PyTorch. That said (if this becomes and NDK priority), they could definitely use some help and NDK guidance, particularly around libc++. Could be a good partnership opportunity! (It seemed like one barrier to libnativehelper was that it depended on some other private libraries?) |
There's already a CL up that adds libnativehelper to androidx. It's blocked on some infrastructure problems that won't be resolved soon, but the work is largely done. |
Oh, cool! Thanks for letting us know. Any chance there's a public link where we can follow the progress? (Maybe that's here.) (I'm also curious what the infra blockers are!) |
If it's still a goal to look at other efforts to see if there are any goodies to bring in, I'd be way curious what you Googlers think of fbjni! (Last I checked, it seemed like it might have some additional good ideas.) |
Not really. https://android-review.googlesource.com/c/platform/frameworks/support/+/2089324 is the CL, but there isn't any ongoing conversation anywhere, and I assume that's what you're looking for.
externalNativeBuild can't do remote caching. |
As discussed on Reddit, here is an improvement idea.
Either adopt one of the following C++ JNI libraries:
Or having a Google provided one that takes advantage of templates and compile time programming to wrap JNI calls into C++ type safe calls, without the low level strings, similar to the approaches taken by the libraries above.
The text was updated successfully, but these errors were encountered: