A sample command-line application that interops with Java code
using package:jnigen
,
with an entrypoint in bin/
and library code in lib/
.
To generate bindings, run:
dart run jnigen --config jnigen.yaml
The dynamic libraries must be built, and the java source must be compiled before running the example.
dart run jni:setup
javac java/dev/dart/Example.java
Now you can test the code:
dart run jnigen_example:sum 17 25
Outputs:
42