Oculus Mobile Software Development Kit (SDK) Device and Environment Setup Guide v. 0.4 I. Introduction Welcome to the Oculus VR Mobile Software Development Kit! This SDK will demonstrate how to implement highperformance, highquality and fullyimmersive Virtual Reality applications for Samsung Gear VR.. If you are new to the SDK, this document contains all of the information you need to get started.
Minimum System Requirements The following computer system requirements for the Oculus Mobile SDK are based on the Android SDK system requirements: ● Windows: 7 ● Mac OS: 10.6+ (x86 only) ● Linux: Ubuntu 12.04 LTS ○ GNU C Library (glibc) 2.7 or later is required ○ 64bit distributions capable of running 32bit applications ● 2.0+ GHz processor ● 2 GB system RAM Supported Devices ● Samsung Note 4 ● Samsung Gear VR Target Device Requirements ● API level ○ 19 (Android 4.4.
I.2 Getting Started To become acquainted with the Oculus Home VR environment and with using Gear VR, we suggest starting with the Samsung SMR320 User Manual and Gamepad User Manual (bundled with the device contents). To dive into the SDK set up and configure your development environment, refer to Section III. Device Setup and Section IV. Android Development Environment Setup in this guide.
II. SDK Overview II.1 Initial SDK Setup II.1.1 Install the SDK The mobile SDK is composed of a compressed archive in .zip format which contains both source and media files: ovr_mobile_sdk_yyyymmdd.zip. Once downloaded, extract the .zip file into a directory of your choice (e.g., C:\Oculus\Mobile). II.1.2 What’s Included Included with this SDK, you will find the following: ● VrLib, the native framework for building highperformance VR Applications.
Plays 2D & 3D movies in a virtual movie theatre. Native Oculus Cinema Native Loads a scene which can be navigated using a gamepad. VrScene Unity A simple game example in which blocks can be thrown to knock over structures and collect stars. BlockSplosion An example app that renders a scene and character from Shadowgun by Madfinger Games. Unity Shadowgun by Madfinger Games Note: The sample applications included with the SDK are provided as a convenience for development purposes.
Oculus 360 Video 360 degree Panoramic video Oculus\360Videos Oculus 360 Photo (360 degree static photos) Note: non360 degree photos will not render properly. Oculus\360Photos II.1.3 What You Need To Run Your Own App - Oculus Signature file Application signing is an important step in this process. In order to access the full functionality of the VR APIs, your app will require a temporary Oculus Signature file (osig).
III. Device Setup This section will provide information on how to setup your supported device and gamepad for running, debugging, and testing your Gear VR application. Please review the Supported Devices above for the list of supported devices for this SDK release. Note: This information is accurate at the time of publication of this document.
To verify that the driver successfully recognized the device, open a command prompt and type the command: adb devices Note: You will need to successfully setup your Android development environment in order to use this command. See the next section: Android Development Environment Setup If the device does not show up, verify that the device is turned on with enough battery power, and that the driver is installed properly. Mac OS If you're developing on Mac OS X, you do not need to install USB drivers.
III.2 Configuring your Android Device for Debugging In order to test and debug applications on your Android device, you will need to enable specific developer options on the device. III.2.1 Note 4 Developer Options Developer options may be found under: Home > All Apps > Settings > System > Developer options Developer options may be hidden by default. If so, you can expose these options with the following steps: 1. Go to Home > All Apps > Settings > System > About device. 2.
Verify apps via USB: This will check installed apps from ADB/ADT for harmful behavior. III.2.2 Display Options The following display options are found in: Home > Apps > Settings > Sound and Display Lock screen/Screen Security/Screen lock: When set to None the Home screen is instantly available, without swipe or password. Useful to quickly get in and out of the phone. Display/Screen timeout: Set the time to your desired duration.
IV. Android Development Environment Setup This section describes setup and configuration of the Android Development Environment necessary for building Oculus Android mobile applications. Note: this section describes installation and configuration of thirdparty systems that are undergoing development. Whenever possible, we strongly recommend installing only the versions specified or recommended by the documentation, as unanticipated changes may break compatibility. IV.
Make sure your JAVA_HOME variable does not include quotation marks. If you use setfrom the command line, the correct syntax is: set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_11 Do not use quotes with the ‘set’ command, even though the path has a space in it. Also, please verify your installation path this example is based on the default installation of Java SE 8u11. IV.1.
IV.1.3 Installing Additional Packages and Tools The Android SDK does not include everything you will need for development by default. You will need to download additional packages via the SDK Manager before you begin. Note: Before launching the SDK Manager, make sure you have installed the JDK as outlined in Section IV.1.1 of this document. SDK Manager may fail to launch if it has not been installed. 1. Launch the Android SDK Manager located at: C:/Dev/Android/adtbundle/SDKManager.
5. Open Android 4.4.2 (API 19) and select the items for SDK Platform and ARM EABI v7a System Image. Note that Oculus Mobile SDK projects use API level 19.
6. Click Install X Packages, where X is the number of selected packages (it may vary based on what needs to be updated). 7. On the next dialog, choose Accept License. 8. Click Install to install and update packages. You may install additional packages above API 19 if you wish. Android SDK Tools 23.0.2, Android SDK Platformtools 20 and Android SDK Buildtools 20 have all been verified to work correctly with the SDK.
The latest version of NDK is available for download at the following location: https://developer.android.com/tools/sdk/ndk/index.html Once downloaded, install NDK to your Android development folder, e.g.: C:\Dev\Android\androidndkr10c\. Add the NDK location to your PATH, e.g.: C:\Dev\Android\androidndkr10c\. Add the environment variable ANDROID_NDK which should be set to your Android NDK location, e.g.: C:\Dev\Android\androidndkr10c.
If the NDK option under the Android section is missing, something went wrong with the Eclipse ADT Plugin installation. Full instructions and troubleshooting information may be found here: http://developer.android.com/sdk/installing/installingadt.html#Troubleshooting IV.1.6 Apache Ant Apache Ant is a Java library and commandline build system. It provides a number of builtin tasks which simplify building Java projects. The Apache Ant project is part of the Apache Software Foundation.
Next, add the Ant bin folder to your PATH, e.g.: C:\Dev\Android\apacheant1.9.3\bin. For more information on using Ant to automate building Android Apps, see: http://www.androidengineer.com/2010/06/usinganttoautomatebuildingandroid.html IV.2 Android Development Software Setup for OS X IV.2.1 Xcode Before installing any Android development tools, you must install Xcode.
The architecture selected for the JDK above must be the same as the ADT (i.e., both must be either 32bit or 64bit). Note: The tilde character followed by a forward slash (~/) is shorthand for the current user’s home folder. It is used throughout this section. In your home folder, create a new folder named “dev”. To get to home folder in OS X, open Finder and press CMD+Shift+H. Once downloaded, unzip the ADT archive (if necessary) and save to your “dev” folder.
Select Open to start Eclipse. If you get a message that Eclipse needs JRE 6 in order to run, allow it to download and install JRE 6. Next, you should see a window asking you to select your workspace: Select Browse and locate or create the directory for your workspace: If you plan to always use this same workspace, you can select the checkbox labeled Use this as the default and do not ask again. Choose OK. IV.2.
1. In Eclipse go to Window > Android SDK Manager to open a window similar to the following: 1. Note that some packages are already selected for installation by default. Leave these projects selected. 2. If not already selected under Tools, select Android SDK Tools, Android SDK Platformtools, and Android SDK Buildtools. 3. Open Android 4.4.2 (API 19) and select the items for SDK Platform and ARM EABI v7a System Image under it. 4.
You may install additional packages above API 19 if you wish. Android SDK Tools 23.0.2, Android SDK Platformtools 20 and Android SDK Buildtools 20 have all been verified to work correctly with the SDK. IV.2.5 Android Native Development Kit The 2.4 Android Native Development Kit (NDK) is a toolset that allows you to implement parts of your app using nativecode languages such as C and C++. It is used extensively by the sample applications which come with this release.
packages can be avoided. It is recommended you use the above naming scheme so that there is no question which version of the ADT bundle and the NDK are installed. You can read more about installation and use of the NDK here: http://developer.android.com/tools/sdk/ndk/index.html#installing Configure Eclipse for NDK Usage Launch Eclipse and go to the ADT > Preferences window. Under Android, verify that Eclipse knows the location of the Android Development Tools.
Under Android > NDK set the NDK folder to the location where you installed the NDK: 24
To set environment variables specifying the locations of Android SDK and NDK on your system, and to add Android tools to your global path: 1. Launch a terminal. 2. At the prompt type the following three lines: echo ‘export ANDROID_HOME=~/dev/adtbundlemacx86_6420140702/sdk’ >> ~/.profile echo ‘export ANDROID_NDK=~/dev/androidndkr9c’ >> ~/.profile echo ‘export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platformtools:$ ANDROID_NDK’ >> ~/.
For additional information about the JAVA_HOME folder and how to determine its location, see: http://stackoverflow.com/questions/18144660/whatispathofjdkonmac http://www.mkyong.com/java/howtosetjava_homeenvironmentvariableonmacosx/ To verify the $PATHvariable and *_HOMEvariables are set correctly: 1. Launch a new terminal window (from Terminal, press Cmd+N). BE SURE to do this from a new Terminal window.
You should see something like the following screen where you can use the arrow keys to navigate the file and edit text: When you are finished editing, hit Ctrl+X to save, answer Y to overwrite and Enter to select the current file. IV.3 Android Development Software Setup for Linux (Ubuntu 14.04) IV.3.1 Java Development Kit Installing the Java Development Kit (JDK) with aptgetis very straightforward. Just type the following into a console: sudo aptget update sudo aptget install defaultjdk IV.3.
1. Note that some packages are already selected for installation by default. Leave these projects selected. 2. Check Android 4.4.2 (API 19). 3. Click the Install X Packages button, where X is the number of selected packages (it may vary based on what needs to be updated). 4. On the next dialog, choose Accept License. 5. Click Install to install and update packages. 6. Some examples may use an older API version than 19.
V. Troubleshooting V.1 Device Troubleshooting V.1.1 View is tilted If the headset view is tilted to the left or right, there is probably an issue with sensor calibration. Take off the headset and place it face down on a flat surface for around 5 seconds to prompt the device to reorient the sensors. When you put the device back on your head, the view should be level. V.1.2 Device not (or no longer) recognized Even if a device worked fine previously, it may enter a state in which it is no longer recognized.
Windows appears to sometimes autoupdate or autorollback the correct Samsung USB driver when the phone is reconnected. If this occurs, you should see a Windows notification that it is installing a driver when you connect your phone via USB. Should this happen, reinstall the correct driver. V.1.3 Device regularly reconnects The device may enter a state in which it reconnects regularly, or in the middle of sessions.
C:\Dev\Android\android_adt_bundle_20140702\sdk\tools\ant\build.xml:698: null returned: 1 If you add the verboseoption to the Ant build, you will see an error such as: invalid resource directory name: C:\Dev\Android\VrTestApp\bin\res/crunch This appears to happen for projects which refer to library projects there is currently no explanation why it occurs. To fix the problem, delete the bin/res/crunch folders that are generated in VrLib/ and VrTestApp/. V.2.2 Eclipse Problems Spaces in Android tool paths.
If you already have an existing installation of the Android Development Tools prior to 23.0.2, you may see compatibility errors when starting Eclipse depending on which packages you downloaded from the SDK Manager. In some cases you may be able to fix these compatibility issues by going to Eclipse > Help > Install New Software. Add the URL https://dl-ssl.google.com/android/eclipse/ in the Work with: field and select Add.
Last Update: Nov 10, 2014 OCULUS VR is a registered trademark of Oculus VR, LLC. (C) Oculus VR, LLC. All rights reserved. All other trademarks are the property of their respective owners.