Hello,Is it possible to embed the hermes to an android app but do not use the RN?
Yes, it is possible.
First, I should set expectations a bit here. We are interested in use cases based on direct integration with JSI, but we're pretty busy right now with our priority right now is supporting React Native. We don't have a lot of documentation on how to integrate this end-to-end, and we may not have a lot of resources to help support this kind of use case in the short term. If you can get something working and send us a PR for hermes which documents this better, that would be awesome!
That said, here's a few pointers to get you started. You would use the makeHermesRuntime function to create an instance of the hermes interpreter, then use the JSI API to evaluate JavaScript and/or bytecode, manipulate JS Values, and bridge to C++. You can see some example code here. That is a tool which just uses the JSI API to read some JS code, and evaluate it, like this:
$ echo 'var x = [1+2, 3+4]; print(JSON.stringify(x));' | ./bin/hermes-jsi
[3,7]
This is just a command line tool. The more complex part of the integration will be packaging up an android app which includes all the necessary native libraries and integrates them with Java. For that you should look at the way React Native builds and integrates Hermes as an example.
Most helpful comment
Yes, it is possible.
First, I should set expectations a bit here. We are interested in use cases based on direct integration with JSI, but we're pretty busy right now with our priority right now is supporting React Native. We don't have a lot of documentation on how to integrate this end-to-end, and we may not have a lot of resources to help support this kind of use case in the short term. If you can get something working and send us a PR for hermes which documents this better, that would be awesome!
That said, here's a few pointers to get you started. You would use the
makeHermesRuntimefunction to create an instance of the hermes interpreter, then use the JSI API to evaluate JavaScript and/or bytecode, manipulate JS Values, and bridge to C++. You can see some example code here. That is a tool which just uses the JSI API to read some JS code, and evaluate it, like this:This is just a command line tool. The more complex part of the integration will be packaging up an android app which includes all the necessary native libraries and integrates them with Java. For that you should look at the way React Native builds and integrates Hermes as an example.