-
Notifications
You must be signed in to change notification settings - Fork 8
JNI bindings to java #75
Comments
To use auto-generation tools for providing bindings we need to provide an interface with std-types instead of Eigen types. After discussion with @g-ferrer-sk , that will be some cut subset of the current module interface. Why would we like to use auto-generation? In that case all type conversions of functions and objects are in the responsibility of the tool that generates bindings, no need to manually track all changes in new functions and their signatures. Candidate tools. JavaCpp, Scapix, hope that @pmokeev could provide below detailed comments on review about all possible tools. So, there are three steps regarding this task
|
In total, several tools were considered to integrate the library into an android application:
I think it is convenient to use this tool if you need to write one or two functions in C++, but nothing more.
There are a lot of usage guides for this tool, so everyone can use it if they want to. This tool does not suit us, just look at the first disadvantage.
The tool is good enough. Generates a bridge from an interface file. The developer must write the interface himself in the IDL file, which will then be used to create the library.
Disadvantages:
As a conclusion: the tool is good enough and can be used, but we would like to achieve more automation of the process.
SWIG has put together part of the original JNI and part of Djinni. It also generates an interface using a special file like Djinni, from which the first disadvantage written in the block about Djinni follows. In addition to this, SWIG generates a .dll / .so / .dylib file (like original JNI), as a result of this we need to use something additionally (generate a library for a specific platform yourself).
But unfortunately we cannot use it because of the .dll / .so / .dylib file.
This is the first of two tools that really interest us. Let's consider it in detail, let's start with the good ones:
But there is a significant disadvantage: In order for us to use methods from our library, we must include a header file in the source file, and inherit the file from some class. Unfortunately, we cannot connect the library via submodule, we will have to change the source files. A question on this topic was asked to the developer, while we are waiting for his ideas on this matter. If this is not important for us, then this tool is perfect for our task. UPD 30.08.2021 : The developer's answer is that he is working to ensure that the library files can be left unmodified. This will take a couple of weeks.
So far, this tool looks the most promising of all those previously presented.
At the moment, this looks like the most attractive option. It is also worth mentioning for which platforms this or that tool is capable of generating bridges:
|
For andriod apps. Here it should be better clarified which applications exactly can be used in this context.
The text was updated successfully, but these errors were encountered: