From a54c2c2ad54e7b7030d3c2c400d591e4412b0264 Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Wed, 12 Aug 2026 21:55:16 +1200 Subject: Initialise build system stuff and boilerplate --- jni/Android.mk | 13 +++++++++++++ jni/Application.mk | 1 + jni/main.c | 22 ++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 jni/Android.mk create mode 100644 jni/Application.mk create mode 100644 jni/main.c (limited to 'jni') diff --git a/jni/Android.mk b/jni/Android.mk new file mode 100644 index 0000000..d9fbd00 --- /dev/null +++ b/jni/Android.mk @@ -0,0 +1,13 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := moku +LOCAL_SRC_FILES := main.c +LOCAL_LDLIBS := -llog -landroid + +LOCAL_STATIC_LIBRARIES := android_native_app_glue + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,android/native_app_glue) + diff --git a/jni/Application.mk b/jni/Application.mk new file mode 100644 index 0000000..9ddd3c4 --- /dev/null +++ b/jni/Application.mk @@ -0,0 +1 @@ +APP_ABI := arm64-v8a diff --git a/jni/main.c b/jni/main.c new file mode 100644 index 0000000..f309e64 --- /dev/null +++ b/jni/main.c @@ -0,0 +1,22 @@ +#include +#include + +void android_main(struct android_app *state) { + /* Declarations */ + struct android_poll_source *source; + int events; + + /* Code starts here */ + app_dummy(); + + /* do stuff here */ + + while (1) { + if (ALooper_pollAll(-1, NULL, &events, (void**)&source) >= 0) { + if (source) { + source->process(state, source); + } + } + /* more stuff here */ + } +} -- cgit v1.2.3