HeapsIO / heaps

Heaps : Haxe Game Framework
http://heaps.io
MIT License
3.19k stars 338 forks source link

iOS and Android support #422

Open ncannasse opened 6 years ago

ncannasse commented 6 years ago

There are often questions about Heaps compilation for iOS or Android. We need to update the Wiki with these

qkdreyer commented 4 years ago

I got both iOS and Android support with ci build status working :

Even if the android build generates an apk artifact, it still needs more work because I'm not correctly initializing heaps in it yet

zommerfelds commented 3 years ago

@qkdreyer how far did you get with the Android build? Does the demo app work in the apk or is there still work to be done?

qkdreyer commented 3 years ago

Actually the apk builds but the app doesn't run properly because of some ndk library issue. I will try to look at it again when a newer version of it get released :)

Lerg commented 3 years ago

Today I was able to run a minimal heaps project on Android. It was hard, but I've managed to get the right combination of libraries and tools. Based on @qkdreyer repo. Gradle 6.5 (latest) NDK tools 21.3.6528147 (22 doesn't work) SDL2 2.0.14 (latest) OpenAL didn't update, the latest version doesn't compile. targetSdkVersion 30 with androidx appcompat

Basically I had to update SDL2, including it's Java files. And add this to HeapsActivity

protected String getMainFunction() {
    return "main";
}
zommerfelds commented 3 years ago

@Lerg, any way you can share your working project with build instructions?

qkdreyer commented 3 years ago

@Lerg feel free to drop a PR on https://github.com/qkdreyer/heaps-android if you can :)

zommerfelds commented 3 years ago

Hey all, I want to share a different approach I've built using Cordova (WebView based): https://github.com/zommerfelds/heaps-cordova

I automated the whole APK generation process inside Docker (see README). No build tool or Android Studio is needed since Cordova can handle building the package. This is using the Haxe JS target, so in the end the app runs in a WebView inside the app. So far I've been very happy with this approach for my simple game. I only set it up for Android but it should be simple to add the iPhone target to the Cordova project. Feel free to comment.

Of course a native approach like @Lerg's would potentially be nicer for performance reasons. (Weirdly though, I noticed some things run smoother on my laptop browser than on the HashLink version.)

Lerg commented 3 years ago

Can you give me a heaps game/tool source code that would be a good fit for testing on a device?

zommerfelds commented 3 years ago

I currently don't have any apps to share but I presume a Heaps hello world would be a good place to start?

qkdreyer commented 3 years ago

@Lerg maybe you can use the heaps world sample as reference :

cd samples && haxe -hl world.hl World.hx -lib heaps -lib hlsdl -lib hxbit -lib format -lib hashlink -D resourcesPath=world_res -main World && hl world.hl
rainyt commented 2 years ago

E/libEGL: validate_display:92 error 3008 (EGL_BAD_DISPLAY)

I created APK based on the template, and now I have this problem. What could it be?

rainyt commented 2 years ago

https://github.com/rainyt/zyheaps

Hi, these are some of my achievements. It has the ability to compile heaps Android targets