# OrbbecSDK-Android-Wrapper **Repository Path**: orbbecdeveloper/OrbbecSDK-Android-Wrapper ## Basic Information - **Project Name**: OrbbecSDK-Android-Wrapper - **Description**: 基于Orbbec SDK的Android Wrapper - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-12-13 - **Last Updated**: 2025-05-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Quick start > [!IMPORTANT] > > Welcome to the Android wrapper . Before you begin using this version of Android wrapper , it's crucial to check the following device support list to verify the compatibility. Here is the device support list of main branch (v1.x) and v2-main branch (v2.x):
Product Series Product Branch main Branch v2-main
Gemini 330 Gemini 335 full maintenance recommended for new designs
Gemini 336 full maintenance recommended for new designs
Gemini 330 full maintenance recommended for new designs
Gemini 335L full maintenance recommended for new designs
Gemini 336L full maintenance recommended for new designs
Gemini 330L full maintenance recommended for new designs
Gemini 2 Gemini 2 full maintenance recommended for new designs
Gemini 2 L full maintenance recommended for new designs
Gemini 210 not supported recommended for new designs
Gemini 215 not supported recommended for new designs
Gemini 2 XL recommended for new designs to be supported
Astra Astra 2 full maintenance recommended for new designs
Astra+ limited maintenance not supported
Astra Pro Plus limited maintenance not supported
Astra Mini Astra Mini Pro full maintenance not supported
**Note**: If you do not find your device, please contact our FAE or sales representative for help. **Definition**: 1. recommended for new designs: we will provide full supports with new features, bug fix and performance optimization; 2. full maintenance: we will provide bug fix support; 3. limited maintenance: we will provide critical bug fix support; 4. not supported: we will not support specific device in this version; 5. to be supported: we will add support in the near future. ## download source ``` git clone https://github.com/orbbec/OrbbecSDK-Android-Wrapper.git ``` ## import project 1. Open Android studio 2. Menu: File --> open, and select project directory 3. Click Ok button 4. wait gradle sync complete ![](doc/readme-images/Open-module-Android-wrapper.png) ## run example ### build example ![](doc/readme-images/run-example.png) ### Main UI ![](doc/readme-images/Example-HelloOrbbec.png) Click 'DepthViewer' to show depth sensor stream. ### DepthViewer ![](doc/readme-images/Example-DepthViewer.png) # Build Tools ## Android studio Android studio **Giraffe | 2022.3.1 Patch 1** download link [Android studio](https://developer.android.com/studio) ## NDK **version:** 21.4.7075529 ## CMake **version:** 3.18.1 ## gradle gradle/wrapper/gradle-wrapper.properties ```txt distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip ``` ## gradle pulgins build.gradle ```groovy plugins { id 'com.android.application' version '8.1.0' apply false id 'org.jetbrains.kotlin.android' version '1.8.10' apply false id 'com.android.library' version '8.1.0' apply false } ``` # library and example ## sensorsdk Orbbec basic sdk implementation with c & cpp, android wrapper import sensorsdk as so. ## so files **path:** obsensor_jni/libs ## include headers **path:** obsensor_jni/src/main/cpp/sensorsdk _Note_: To short include path in native code, module of 'obsensor_jni' import as path 'obsensor_jni/src/main/cpp/sensorsdk/include/libobsensor' ## obsensor_jni Android wrapper implementation with jni which is forward or transfer data between java and native sensorsdk. ## Support android version - Test on the Android 13 - Note: If using Android 10, set targetSdk to 27 ```groovy minSdk 24 //noinspection ExpiredTargetSdkVersion targetSdk 27 ``` **targetSdkVersion** 27 to fixed bug 'Android 10 Devices Do NOT Support USB Camera Connection' which fixed on android 11. \[reference 01] [Android 10 sdk28 usb camera device class bug.](https://forums.oneplus.com/threads/android-10-sdk28-usb-camera-device-class-bug.1258389/) \[reference 02] [Android 10 Devices Do NOT Support USB Camera Connection.](https://www.camerafi.com/notice-android-10-devices-do-not-support-usb-camera-connection/) ## example Example of sensorsdk android wrapper # Support orbbec device OrbbecSDK:v1.10.3 Support device list (firmware version): | SDK version | Product | Minimal Firmware version | | --- | --- | --- | | v1.10.3 | Gemini 335 | 1.2.20 | | | Gemini 335L | 1.2.20 | | | Gemini 336 | 1.2.20 | | | Gemini 336L | 1.2.20 | | | Gemini 2 XL | Obox: V1.2.5 VL:1.4.54 | | | Astra 2 | 2.8.20 | | | Gemini 2 L | 1.4.32 | | | Gemini 2 | 1.4.60 | | | Astra+ | 1.0.19 | | | Femto | 1.6.7 | | | Femto W | 1.1.8 | | | DaBai | 2436 | | | DaBai DCW | 2460 | | | DaBai DW | 2606 | | | Astra Mini Pro | 1007 | | | Gemini E | 3460 | | | Gemini E Lite | 3606 | | | Gemini | 3018 | | | Astra Mini S Pro | 1005 | # Simple code of open depth stream Create OBContext global member to manager attach devices ```java // Application hold only one OBContext instance. private OBContext mOBContext; private Object mCurrentDeviceLock = new Object(); private Device mCurrentDevice; private DeviceInfo mCurrentDeviceInfo; ``` Initialize OBContext with DeviceChangedCallback ```java mOBContext = new OBContext(getApplicationContext(), new DeviceChangedCallback() { @Override public void onDeviceAttach(DeviceList deviceList) { try { mDevice = deviceList.getDevice(0); deviceList.close(); // do something mDevice.close(); } catch (Exception e) { e.printStackTrace(); } } @Override public void onDeviceDetach(DeviceList deviceList) { try { if (null != mCurrentDevice){ int deviceCount=deviceList.getDeviceCount(); for(int i=0;i Failed to apply plugin 'com.android.internal.application'. > Could not create an instance of type com.android.build.gradle.internal.dsl.ApplicationExtensionImpl$AgpDecorated. > Could not create an instance of type com.android.build.gradle.internal.dsl.LintImpl$AgpDecorated. > Could not generate a decorated class for type LintImpl$AgpDecorated. > com/android/tools/lint/model/LintModelSeverity has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0 * Try: > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. ``` **Reason**: AGP(android gradle plugin) is v8.1.0, need jdk 17, Please update android studio to new version, and check gradle jdk version. Android studio --> File --> Settings --> Build,Execution,Deployment --> Build Tools --> Gradle, check Gradle Projects -> Gradle JDK **reference**: https://developer.android.com/studio/releases#android_gradle_plugin_and_android_studio_compatibility https://developer.android.com/build/releases/gradle-plugin