Fun with Native Code on Android
summary
Builds a working Android TV emulator front end by wiring C libraries to Kotlin with Java Native Access (JNA) instead of JNI, using generated bindings (JNAator) and hand-written structures to call a subset of the libretro API (25 functions, 31 structs total but only the ones needed). Implements audio, video and input callbacks, discovers and implements a required environment callback, runs a 60Hz frame loop, loads ROMs from SD/HTTP, and ships a prototype called Odyssey that plays multiple libretro cores (7 platforms) with sound and controller input.
AI-written summary · about
chapters (11)
- 0:00Introduction and project motivation
- 1:44App requirements and design
- 3:49Native code and JNI basics
- 6:59Introducing Java Native Access
- 14:26LibRetro and emulator integration
- 17:37LibRetro callbacks and game loop
- 20:47JNA bindings for LibRetro
- 24:39Implementing audio and video callbacks
- 28:12Handling game controller input
- 31:02Tying it all together and demo
- 35:25Future plans and project status
related talks
34mFrom Linux to Android: the samurai's journey
32mGetting Started with the Android NDK
05mBest practices using JNI
43mUsing JNI without running into disaster
44mSwift on Android: The Future of Cross-Platform Programming?
48mIt's all Fun & Games on Android
40mClojure on Android
53mAndroid: He protec, but he also attac
