Skip to main content

Ready to market your stellar app?

Samsung Developer Program is your gateway to app monetization success.

Learn More

Samsung Developer Program

Build Instructions

GearVRf app requirements, build instructions, building and running, and sample apps

In order to build and and run GearVRf applications (your own or sample apps) in Android Studio, you have two options:

  • Locally build the Gear VR Framework from the latest source code files.
  • Use a previously built Gear VR Framework from the latest release files.


Locally Build Gear VR Framework   Use Previously Built Gear VR Framework
Prerequisites (with source code download)   Prerequisites (with source code and pre-built release download)
Build Gear VR Framework    
Generate GearVRf API Details (optional)    
Building and Running GearVRf App   Building and Running GearVRf App




For BOTH methods, locally building AND using a pre-built framework, the following prerequisites must be met.


  1. Latest Gear VR Framework
    1. When locally building the framework:
      1. Get the latest source code zip file:
        1. In, click Download ZIP
        2. Unzip to path to a convenient local directory (the GearVRf directory) 
          in order to use the Gear VR Framework source code files.
    2. When using a pre-built framework:
      1. Get the latest source code zip file:
        1. In, click Download ZIP
        2. Unzip to path to a convenient local directory (the GearVRf directory).
      2. Get the latest release zip file:
        1. In the GitHub GearVRf releases, click
        2. Save the zip file to a convenient local directory.
        3. On your local machine, unzip the file and put the unzipped libs folder into your GearVRf app folder 
          (for example, /gvrfApp/libs-gvrf/gvrf_exported.jar and /gvrfApp/libs-gvrf/lib/). Also copy the Oculus library files, such as VrApi.jar, VrAppFramework.jar, and SystemUtils.jar to the same location.
  2. JDK 1.7 or above 
    Download it from
  3. Android Studio 2.1 or later
  4. Oculus Mobile SDK 1.0.4
    Download it from
    Put the Oculus SDK folder at the same directory level as your GearVRf directory. 
    For example, if your GearVRf directory path is / path / to / convenient / local / directory / GVRf / 
    put the Oculus SDK in / path / to / convenient / local / directory / ovr_sdk_mobile/ 
    NOTE: Remove the version information from the pathname.
  5. Android SDK (version 5.0.1, or higher, is preferred) and/or KitKat SDK (version 4.4.x ) 
    1. After you set up the Android Development Tools, open the Android SDK Manager.
    2. Download the newest version of Android SDK Tools and build tools.
    3. Download Android 5.0.1 (API 21) and 4.4.x (API 19).
  6. Download Android NDK (version r10e or later) from




Oculus Mobile SDK

For BOTH methods, you need the Oculus Mobile SDK. Unzip the Oculus Mobile SDK to ovr_sdk_mobile/ into the GearVRf/ directory.

  1. Add the OVR_MOBILE_SDK to and set it to the path to the Oculus Mobile SDK.
    It is recommended to use the global ($HOMEPATH/.gradle/ or ~/.gradle/


Building Gear VR Framework

You can locally build GearVRf using Android Studio.


To locally build the Gear VR Framework using Android Studio:

  1. Add OVR_MOBILE_SDK to and set it to the path to the Oculus Mobile SDK; recommended to use the global ($HOMEPATH/.gradle/ or ~/.gradle/
  2. Add ANDROID_NDK_HOME to and set it to the path to the Android NDK installation.
  3. Navigate to the GearVRf/GVRf/Framework and select the folder, and click OK
  4. Click Make Project (from the Build menu)



Generating a GearVRf API Reference Javadoc

When locally building the Gear VR Framework, you can optionally generate Javadoc files with details about the GearVRf API.


Optional   To get GearVRf API reference details by generating GearVRf Javadoc files in the specified directory:

  1. In Android Studio, click Project > Generate Javadoc...
  2. In the Generate Javadoc window:
    1. Javadoc command: (Pathname to the Javadoc executable file)
      Typically, in the bin directory of the Java directory.
    2. Click on the plus-icon to expand the Framework listing.
    3. Checkmark src
    4. Select Use standard doclet
    5. Destination: (Convenient local directory to contain the Javadoc files)
    6. Optional Specify VM options:
      NOTE: You may encounter errors if VM options is not specified.
      1. Click Next >
      2. Click Next >
      3. VM options: -bootclasspath [path to your Android jar file]
        (Typically the pathname ends in .../android/sdk/android.jar)
    7. Click Finish


Building and Running GearVRf Applications

After you have the Gear VR Framework, by either locally building or using a pre-built framework, you can now import, build, and run GearVRf applications (your own or sample apps) in Android Studio. The specific procedure you use depends on whether you locally built the Gear VR Framework from source code files or used pre-build framework files.


  1. When building your own GearVRf apps from scratch, copy the appropriate device XML file from the GearVRf SDK to your application's assets folder. 
    GearVRf provides an xml file for you to use: gvr.xml.
  2. Import the GearVRf application code.
    • Click File -> Open ...
    • Navigate to the project folder (for example, gvr-sample).
    • Click OK
  3. Clean and build the application.
    • Go to the Build menu and click Clean...
    • Click Make Project (from the Build menu)
  4. Run the application.
    NOTE: You may need to apply to Oculus for a signature file for your device.
    For application and use details, refer to the online signature generator (
    1. Connect an Android mobile device to your local machine.
    2. Select your project in the project explorer
    3. Click Run on the toolbar
  • Was this article helpful?