Integrate and Embed Unity With Android for Kotlin
This article is a result of work of many other developers and blog post of Unity itself about integration with Android. I wrote this article so that it can help beginners to get their project started with integrating unity and android.
In this article, we will be doing a step by step procedure of exporting a Unity project as an Android source code and then using that as library into our native Kotlin Android app. We will create a simple Unity application and embed it in the Android app. We will also do communication from Android to Unity and Unity to Android as well.
Create a simple unity application and export it as a Android Source. Please note that I’ve used the Unity Version 2019.3.9f1. Any version above this should also be okay. Please install the Android support modules for the same version if not already present.
- Start by creating a new Unity project as seen in the image below. We will name this as UnityProject and the root folder name will be AndroidUnitySample.