Zig & Android

Getting into Android with Jetpack Compose, hopefully soon i will be learning the NDK. Wanting to see if others are wanting to replace C/C++ code with Zig. Because why not Zig! :slight_smile:

Welcome to Ziggit @k0s!

The showcase category is more for presenting concrete results, this seems more fitting in the Brainstorming category. I will move it there for now.

I will eventually try to compile raylib applications (so a mix of c and zig) to android, but I haven’t yet.

@Sze thanks for moving to the correct category. would you happen to have any recommendations or maybe some links to courses for ndk development? im kinda just finding bits and pieces online on how to integrate c code into a android app

I think starting with what @squeek502 has linked is a good idea, watching the talk and digging into the Android Template.

Personally I haven’t tackled Android yet, so I don’t have a lot of practical things I can recommend, maybe you can find some thing related to it in one of these lists:

I am not really aware of any courses or teaching material available for porting things to android. To me it seems like it is mostly a matter of getting your hands dirty with it and finding out the details while actually getting a project to work.

There are probably a few good blog-posts that describe the most useful steps and resources, but I haven’t researched that yet. Currently web-assembly has higher priority for me, I also wondered whether wrapping a web assembly app into an android application would make sense, but I suspect that it would have much worse performance then using ndk directly and use that to build an android app.

Linked from the GitHub - ikskuh/ZigAndroidTemplate: This repository contains a example on how to create a minimal Android app in Zig. readme: