This is a demo of how to create a custom android plugin.
Use this as a baseline for your plugins.
AndroidPlugin- Android studio project that builds the pluginDemoLib- The actual library to be built
GodotPlugin- Files to necessary for Godot to recognise the pluginGodotProject- Sample Godot project that shows how tot use plugin
- Replace
GodotAndroidPluginDemo\AndroidPlugin\godot-lib.release\godot-lib.release.aarwith the Godot engine library of your choosing- Download the Godot engine library
- Copy to the specified location
- Delete current
godot-lib.release.aar - Rename the downloaded file to
godot-lib.release.aar
- Run
gradlew buildinGodotAndroidPluginDemo\AndroidPlugin - Copy
GodotAndroidPluginDemo\AndroidPlugin\DemoLib\build\outputs\aar\DemoLib-release.aartoGodotAndroidPluginDemo\GodotPlugin - Rename
DemoLib-release.aartoDemoPlugin.aar - Copy both files from
GodotAndroidPluginDemo\GodotPlugintoGodotAndroidPluginDemo\GodotProject\android\plugins - Follow these steps to set up Godot to build for android
- Build the godot project and run
- Export
apkand install on phone - Activate
developer modeon android and enableUSB debuggingindeveloper options
- Export
- Open
GodotAndroidPluginDemo\AndroidPluginproject in Android Studio - Modify
AndroidPlugin\DemoLib\AndroidManifest.xmlfor requirements - Modify
AndroidPlugin\DemoLib\src\main\java\com\gd\android\demolib\InstantiateSingleton.javafor functionality
In GodotAndroidPluginDemo\AndroidPlugin\DemoLib\src\main\AndroidManifest.xml change android:name in the <meta-data\> tag to point to the latest version (e.g. godotengine.plugin.v##.[Name])