Closed flashultra closed 5 years ago
Hi,
It is certainly possible to use bind with Lime/OpenFL, but there is probably some work needed to do the setup.
bind
is an utility to generate bindings and all intermediate code, but it cannot integrate generated files to your lime/openfl android project by itself.
I didn't use lime/openfl for a long time, but you will probably need to find a way to make openfl add the java classes to the android project. That's probably something you can do on the project.xml
file of an openfl/lime project I guess, or by creating a lime/openfl extension.
If I had to do this, I would probably create a script that runs bind
, and that then generates a lime/openfl extension on the fly that integrates generated files by bind
You can find an example of how bind
is used inside my framework ceramic engine
I use the --json
arg on the bind
command to get file content as String, then the script saves the files at the correct locations for my framework.
Note that AppAndroidInterface.java
is just an example of bound java file.
The idea here is that binding Something.java
will generate bind_Something.java
, 'Something.haxe', and both files (+Support.java) need to be added to the android project then.
Thank you for your answer. I''ll check Bind.hx from ceramic engine.
For Android bind generate java class
bind_App<name>.java
andSupport.java
and also cpplinc_App<name>.cpp
with linc xml. In Lime toolchains java files are read from directory\templates\android\template\app\src\main\java\
. I tried to copy generated java bind classes to this directory but can't compile , because the main class AppAndroidInterface cannot be find. I'm not sure how can combine haxe, java and cpp in Lime toolchain. I think bind compiles haxe first to cpp and after that call cpp from javaI'm looking for clean way to write extensions ( at the moment for Lime) and bind looks like at he righst solution.