A simple demo Android app and Unity Didimo project, to demonstrate Didimo SDK integration using Unity as a library.
- Unity Didimo SDK example scene
- Unity script to build to the correct project path
- Simple Android app to facilitate Unity as a library
- Send text to a Unity object from Android app
- Send "Reset Camera" to Didimo SDK from Android app
This project has only been tested with the following development environments:
- [Android Studio] - Arctic Fox
- [Unity] - Unity 2020.3.12f1
Please ensure that you can successfully build a basic Android app using Android Studio and that the JDK is installed before importing this project.
- Open the folder
./didimo-digital-human-unity-project/
with Unity, and choose the Android platform. - In build settings check "Export project".
- Use the Unity top menu to select "Build" → "Build Android" menu option to export to
./NativeAndroidApp/androidBuild
.
-
Open the folder
./NativeAndroidApp/
with Android Studio. -
Configure the file
./NativeAndroidApp/local.properties
to have the correct NDK and SDK paths. You can either:- Point to the Unity install used earlier. You can find these paths on Unity through Edit → Preferences → External Tools. Example:
sdk.dir=C\:\\Unity\\2020.3.12f1\\Editor\\Data\\PlaybackEngines\\AndroidPlayer\\SDK ndk.dir=C\:\\Unity\\2020.3.12f1\\Editor\\Data\\PlaybackEngines\\AndroidPlayer\\NDK
- Alternatively, you can use Android Studio's SDK and NDK. Make sure you have at least SDK Android API 32 installed,
and you are using NDK version 19.x (Windows) or 23.x (Mac). You can get the SDK path by going to Tools → SDK Manager.
The path will be in the "Android SDK Location" text field. The NDK will be installed inside the SDK folder. Example:
sdk.dir=D\:\\Android\\sdk ndk.dir=D\:\\Android\\sdk\\ndk\\19.2.5345600
- Point to the Unity install used earlier. You can find these paths on Unity through Edit → Preferences → External Tools. Example:
-
Go to File → Project Structure... → SDK Location → Gradle Settings. Select a Gradle JDK with version 11.
-
Run a Gradle build.
- If you run into an error similar to
[CXX1104] NDK from ndk.dir at NDK_PATH had version [19.0.5232133] which disagrees with android.ndkVersion [23.1.7779620]
Open the file
NativeAndroidApp/app/build.gradle
, and update the property ndkVersion, which for this case would bendkVersion '19.0.5232133'
-
Run Make Project.
-
Deploy to device or ARM64 emulator.