Develop


Quickstart for Android

Start developing your NRSDK Unity apps for Android.

This quickstart guide will help you set up your development environment and test out the sample app "Hello MR" on NRSDK.



Getting Started

Hardware Checklist

  • A Nreal Computing Unit (Think of it as an Android phone with no screen, so all development processes will be very similar to mobile app development.)

  • A pair of Nreal Light glasses

Don't have an Nreal device? Sign up for the Nreal Developer Kit! Or try the Emulator to pilot Nreal app functions without the Nreal Light glasses and computing unit.

  • An USB-C cable to connect the Nreal computing unit to your PC.

Software Checklist


Setting up the Nreal Computing Unit

Before you start developing, make sure your Nreal Computing Unit is connected to the internet. We recommend using Scrcpy to change the settings.

  • Turn on your Nreal Computing Unit and connect it to your computer via a USB-C cable.

  • Open Scrcpy and select Settings in the menu.

  • Select Network & Internet.

  • Select Wi-Fi and set up your internet connection.


Creating a Unity Project

  • Open Unity and create a new 3D project.

  • Set Build Settings > Player Settings > Other Settings > Api Compatibility Level* to .net 4.x

  • Import NRSDK for Unity

    • Select Assets > Import Package > Custom Package.

    • Select the NRSDKForUnity_1.4.8.unitypackage that you downloaded.

    • In the Importing Package dialog, make sure that all package options are selected and click Import.


Hello MR - Your First Sample App

  • Find the HelloMR sample app in the Unity Project window by selecting Assets > NRSDK > Demos > HelloMR.


Configure Build 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:
Setting Value
Project Settings > Player > Resolution and Presentation > Default Orientation Portrait
Project Settings > Player > Other Settings > Auto Graphics API false
Project Settings > Player > Other Settings > Graphics APIs OpenGLES3
Project Settings > Player > Other Settings > Package Name Create a unique app ID using a Java package name format. For example, use com.nreal.helloMR
Project Settings > Player > Other Settings > Minimum API Level Android 8.0 or higher
Project Settings > Player > Other Settings > Target API Level Android 8.0 or higher
Project Settings > Player > Other Settings > Write Permission External(SDCard)
Project Settings > Quality > V Sync Count Don't Sync

Connect to Nreal Device

  • Enable developer options and USB debugging on your computing unit. Android Debug Bridge (adb) is enabled as default and does not require manual setting).

  • Connect your computing unit to your computer.


Build and Run

  • In the Unity Build Settings window, click Build. We recommend installing your app through Wi-Fi Android Debug Bridge (adb) after the build is successful.

  • Disconnect the computing unit from your computer, and connect it to the glasses.

  • If it is the first time you ran this app, you need to authrize the app with tools like scrcpy.

  • Launch you app along with the Nreal Light controller. For instructions on how to use the Nreal Light controller, please see the Controller Guide.

  • Move around until NRSDK finds a horizontal plane, the detected plane will be covered with a green grid.

  • Click the Trigger button to put a Nreal logo object on it.

  • (Optional) Use Android Logcat to view logged messages. We recommend using Wi-Fi Android Debug Bridge (adb) to connect to your computer so that you do not have to be connected through the data cable most of the time.


Next Steps

  • Use Image Tracking to build apps that can detect and track multiple images in the physical environment.