Skip to content

Unity project with an example on how to run the depthai library in Android.

Notifications You must be signed in to change notification settings

4ndr3aR/depthai-android-unity-example

 
 

Repository files navigation

depthai-android-unity-example

Unity project (built with Unity 2020.3.25f1) with an example on how to run the depthai library in Android.

!depthai unity particle example android

!depthai unity example android

Important

  • This example is a simple example to show how to use the depthai library in Android with Unity. For a proper support of the library in Unity, check the official depthai unity library (link below).
  • Known issue: it is necessary to allow the app to acces the MyriadX (multiple times) every time the app launches. If you have any solutions, please submit a PR.

Repository Info

The repository contains both the Unity project to build the app and the Android Studio project to build the Android library (.aar) for Unity.

  • Unity Depthai Android Example: Unity project with the example scene to build the Android app. Important - Switch to Android before building.
  • depthai-android-api: Android Studio project to buid the Android library (.aar) for Unity. The project contains and empty app (ignore it) and an Android library depthai-android-api. Press the hammer (Make project) in Android Studio to build the library. The compiled library (.aar) will be automatically copied into the Plugins folder of the Unity project.

Compiled App (.apk)

If you want to download the app directly without having to compile the project. You can download it from here:

RGB + Disparity:

https://drive.google.com/file/d/123C3IWq9PXREUvQxnZZVgExs_eSnT-DM/view?usp=sharing

Particle effect (Code coming soon):

https://drive.google.com/file/d/1lIXdfp9rvUkzu6UZXRzzD0vrC04hPNIr/view?usp=sharing

Android JNI Example

Dynamic Library

The arm64 dynamic library (depthai-core) was compiled in Ubuntu 20.04 using the xlink_device_search_improvements branch. If you are interested in compiling it yourself, please ask in the Discord channel referenced below.

License

I have copied directly some of the include folders of the dependency libraries for the Android library. Therefore, all the code except the ones inside the include folder of the Android project are free to use. I will try to fix it adding submodules in the future.

References:

About

Unity project with an example on how to run the depthai library in Android.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 54.6%
  • C 43.4%
  • CMake 0.5%
  • M4 0.5%
  • Makefile 0.5%
  • Shell 0.2%
  • Other 0.3%