-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Support native modules #291
Comments
hi, I wondered how to call the sample code in JavaScript? after the require? and how to provide different so for different architecture? |
There is a small example in this commit. Take a look at bece3ae#diff-c273f07649566e409bd510c972c40aa5R20 |
thanks for the tip, is this technique can only call nsmain? or we can call any function using Java call to jni? |
Yes. {N} for Android does not provide means to for loading general purpose shared libraries. We look for
Currently {N} for Android doesn't provide such functionality. While implementing this functionality is technically possible (and relatively easy to implement), we haven't came across such scenario yet. If there is interest in it then we can add it to our task list. |
OK I understand now. thanks |
Provide support for native modules similar to Node.js addons. Regular JavaScript modules are loaded as follows
Similarly, we can load native module as follows
Native modules provide glue to C and C++ libraries. They are useful in performance sensitive scenarios because they avoid JavaScript-to-Java marshalling. Good examples are OpenGL libraries.
You can find sample implementation of native module here.
The text was updated successfully, but these errors were encountered: