COMMUNITY

Haxe Java Android

Hej all !

Many years ago I have used NME to build Android apps, then I switched to openFL but in my mind, openFL is a lot game oriented.
I wanted to know nowadays the best workflow in order to build kind of native android apps using Haxe, if anyone can advice me please ? Something with Haxe/Java and other things maybe ? Or the best is still to use openFL ?
For example, if I only want an app that checks the incoming call number, something quite raw/native, what would you advice me please ?

Thanks for reading,
Best,

Hi !
At one moment before I also was thinking about support for mobile platforms directly in Haxe and that was my conlcusions in that time :

Lime have a great tooling for compiling to Android and iOS. In fact it use hxcpp commands , so in theory it’s possible ( if use them ) direct to compile apk file . The problem here is that Haxe does not have graphical representation ( display list or something else), so you should write , at example code in Android studio , compile to .so library and use the library with ammer ( https://github.com/Aurel300/ammer ) to include that library in your haxe project. Ammer at the moment not support Android compiling, but it’s doable.

So maybe in future if Ammer has a better mobile support, will be possible easy to include Android libraries , expose them similar to the JS extern , and combining that with tooling ( like Lime andriod / ios support ) to create and compile project in Haxe for Android. Unfortunately not possible at the moment.

Other option for that will be Heaps, but mobile support there is not great. For Kha, I can’t say anything, because I don’t use Kha at the moment.

For your example ( the incoming call numbers) , you should write extension in Android and expose that function to Haxe . I can’t see how that will be possible in other way.
You also can check the bind project ( https://github.com/jeremyfa/bind/) , but it will require ceramic engine to works ( I had a problem to run it in OpenFL when tried before )

So as conclusion, it will be great to have a direct support for a native ( mobile ) code in Haxe ( at example ammer to be part of the main code or some bind integration) and to have a easy tooling for mobile compilation in haxe ( similiar to what Lime have) , but this will not happen ( resources; mobile is not the main focus; etc.).

Maybe writing some mobile extension ( independent of the framework - openfl, ceramic, heaps, kha) would be possible in the future. Who knows .

Thanks for your detailed answer !
So If I understand well, and because I don’t know others libraries and frameworks except openFL, I think I will stay on openFL…

Hey, for native android or ios apps I personally use react native with coconut and numerous externs that are either already there or manageable with ts2hx, but I guess you know all that already.

Thanks for your answer !
No, I’m not really aware about all out of Haxe, I only use Haxe for more than almost 15 years now and for all :rofl:
That’s why I asked something around Haxe, but thanks for your suggestion maybe I should take a look at that

I am also looking out for great native looking mobile UI myself and stay inside of haxe.
I have found HaxeUI which I think builds on stop off openfl, you might have already seen that though.

It seems like you can use hxwidgets, to get native components. You can see at 6:50 in the this video: Little bit of rambling about #HaxeUI for desktop, web and mobile - YouTube
You will see the android button look android like