I am looking for a way to create a library out of a Defold game that can be embedded inside Android/iOS apps. From the documentation I only found how to build standalone apps (e.g., apks/aabs on Android). For example, on Android my guess was that in the end there is a custom activity that is started and in theory it should be possible to package the game such that in another app I can start that activity somewhere from within the app, e.g., on the click of a button.
Correct,. If you bundle for Android you’ll see that the manifest refers to DefoldActivity, and there’s some Android resources, engine binaries and custom game archive. You might be able to package this as an .aar file and include it in another project as a Gradle dependency.
But isn’t it better if you bundle your Defold game as HTML5 and launch it in a WebView? It works on both iOS and Android.