Comment on page
Getting Started with NRSDK
Start developing your NRSDK Unity apps on Android phone.
This quickstart guide will help you set up your development environment and test out the sample app “Hello MR” on NRSDK.
- An XREAL Computing Unit / Supported Android Phone. Think of Computing Unit as an Android phone with no screen, so all development processes will be very similar to an Android phone. Please review the Device Compatibility to ensure your phone model is well prepared.
- A pair of XREAL Light glasses.
- Android Debug Bridge (adb) debugging and testing through Wi-Fi are not necessary, but are strongly recommended, so as to avoid frequent plugging in and out XREAL glasses from your phone and connecting the phone to the computer.
- (Optional) A USB-C cable to connect the XREAL computing unit to your PC.
We’re going to create a new Unity project and integrate NRSDK later on. To create a new Unity project:
- Open Unity Hub and create a new 3D project.
- Import NRSDK for Unity
- Select the
NRSDKForUnity_x.x.x.unitypackagethat you downloaded.
- In the Importing Package dialog, make sure that all package options are selected and click Import.
You could either configure your project automatically via NRSDK Project Tips tool or configure manually. These two ways are equivalent.
- Go to NRSDK -> Project Tips in Unity menu
- Click Accept All in the popup window
- Wait for Unity to process. The Project Tips window should appear as empty when finished.
- Close the Project Tips window
- Most of the settings have been completed here, but
Write Permissionstill need to be manually configured. Please refer to the manual configuration path below for specific settings.
- Go to File > Build Settings.
- Select Android and click Switch Platform.
- In the Build Settings window, click Player Settings.
- In the Inspector window, configure player settings as follows:
You could specify Target Devices in
Assets/NRSDK/NRProjectConfig.Be aware that all the NRSDK features supported by XREAL Air are supported by XREAL Light . By default, both
Support XREAL Lightand
Support XREAL Airare selected.
By selecting VISION, NRSDK will automatically attempt to adapt to XREAL Air, XREAL Air 2 or XREAL Air 2 Pro even if you had implemented NRSDK features that are based on RGB Camera (plane detection, image tracking, hand tracking, recording, etc. See Device Compatibility for details). However, be aware that the actual behavior of the adapted application may differ from your initial intent.
If you only want the application to run on a specific device (Light/Air), you may arbitrarily specify a single target device. In this way, NRSDK will not try to adapt automatically, and the app will not be running on unsupported devices.
- Find and click
Assets/NRSDK/NRKernalSessionConfigin Unity project folder, make sure the plane tracking, image tracking is configured properly as the following default configuration:
- Force Kill While Glass Switch Mode: Unselect this option to ensure your app will not be killed when users switch the mode between 2D and 3D mode.
- Support Mono Mode: MonoMode is a special feature in our AR system that simulates a 3D experience on a 2D display with a resolution of 1920*1080. When enabled, it allows 3D applications to run without errors, even if not switched to 3D mode via Nebula, by mirroring the content for the left and right eyes. For more details, please refer to Render MonoMode.
Please note that Plane Finding Mode and Image Tracking Mode will implicitly be Disable when
Support XREAL Airis selected in Step 4: Configure Compatible Devices, regardless of your configuration here in the inspector.
- Find the HelloMR sample scene in the Unity Project window by selecting
Assets > NRSDK > Demos > HelloMR.
- Double click
HelloMRto open the scene
- 1.Access the Build Settings in Menu -> File -> Build Settings. Click the button "
Add Open Scene" and make sure the current scene is checked.
2. Click Player Settings. Customize the Company Name and Product Name.
3. (Optional) Navigate to the Android> Other Settings panel to specify your build settings. As you have prepared Step 3. Configure Project Settings, you may leave the current configuration as it is. It is worth noting some of the other settings:
- Multithreaded Rendering: Enable this option to use multithreaded rendering. In most cases, both enabling and disabling this option is supported by NRSDK. However, for the scenes that contains Overlay content, you should disable multithreaded rendering.
- Scripting Backend: Choose either IL2CPP or Mono, but you can only choose IL2CPP when building for ARM64 architecture.
4. In Build Settings window, click Build.
5. Select the destination folder and wait until the building is finished.
- Connect your Phone / computing unit to your Mac / Windows PC.
- Disconnect the computing unit with your PC, and then connect it to the glasses.
- Move around until NRSDK finds a horizontal plane and the detected plane will be covered with green grid.
- Click the Trigger button to put an XREAL logo object on it.
- (Optional) Use Android Logcat to view logged messages. We recommend using WiFi Android Debug Bridge (adb) to connect to your PC so that you do not have to be connected through the data cable most of the time.