Unreal Engine 4 and Samsung Gear VR

UnrealEngine 4 and Samsung GearVR

A simple game using Unreal Engine 4.10.* and 4.11.2 for GearVR

The code can be found at - https://github.com/akshaybabloo/GearVR-UnrealEngine4

Note 1: For Mac users make sure you download Java 6 -> https://support.apple.com/kb/dl1572 and Java 7. The setup is the same for UnrealEngine 4.11.

Table of content

License

The code is provided under MIT License, and the tutorial is provided under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

CC

1 Introduction

In this tutorial, I will be going to develop a simple environment where the first person player can walk around. This game was developed on Mac and should be similar to windows. Please see “Note” where I would be including some important points about the structure and running of the game.

2 Requirements

2.1 General

  1. A 2015 Samsung Galaxy phone i.e. S6, S6 edge, S6 edge+ or Note 5.
  2. Samsung Gear VR.
  3. Experience with Unreal Engine 4. If you don’t have any previous experience, you can go through my tutorial on Unreal Engine 4 here

2.2 Mac

Software

  1. Unreal Engine 4
  2. Android Studio
  3. AndroidWorks

Hardware

  1. A 2015 Samsung Galaxy phone i.e. S6, S6 edge, S6 edge+ or Note 5.
  2. Samsung Gear VR.

2.3 Windows

Software

  1. Unreal Engine 4
  2. Android Studio
  3. AndroidWorks
  4. Samsung drivers

Hardware

  1. A 2015 Samsung Galaxy phone i.e. S6, S6 edge, S6 edge+, S7, S7 edge or Note 5.
  2. Samsung Gear VR.

3 Instillation

3.1 Mac

3.1.1 Android Studio

  1. Download Android Studio.
  2. Open it and move it to Application.
  3. Open the application and follow the installation process.
  4. Once the installation process is done, open the application and do the follow
  5. Click on Android Studio -> Preference
  6. Click on Appreance & Behavior -> System Settings -> Android SDK and tick on Android 5.0.1 and Android 5.1.1.

Installing command line tools

  1. Open Terminal.
  2. Type nano .bash_profile and type the following in it:

  # Android
  export PATH="/Users/<user>/Library/Android/sdk/platform-tools:$PATH"
  export PATH="/Users/<user>/Library/Android/sdk/tools:$PATH"

Note 2: <user> should be replaced by your username.

  1. To save press Control + x and then press y.
  2. Restart Terminal and type android to see if the tools are working.

3.2 Enabling Android Developer Options

  1. Go to Settings -> About -> Software Info and click on Build Number seven times.
  2. Now go back, You should now see Developer Options.

Settings menu

Settings menu

  1. Click on Developer Options and enable `USB debugging.’

Debug enable

Debug enable

  1. Once you connect your phone to the system, it will ask you to confirm the connected computers RSA KEY. Click Ok to continue.

3.3 Getting device ID

Make sure you have your phone connected to the computer, and the USB debugging is switched on. Open Terminal and type in adb devices, this will print an alphanumeric/numeric key something like this.

List of devices attached
1234567891011123    device

3.4 Downloading Oculus Signature File (osig) and placing it in UE

Copy the above number and go to https://developer.oculus.com/osig/ and paste it in the text field then click on Download File. oculussig_1234567891011123 file will be downloaded.

Move this file to /Users/Shared/UnrealEngine/4.10/Engine/Build/Android/Java/assets/

Note for UnrealEngine 4.11: If you can find assets folder, create one and move the file to it.

3.4 Installing CodeWorks for Android

Goto /Users/Shared/UnrealEngine/4.10/Engine/Extras/AndroidWorks/Mac/. Open AndroidWorks-1R1-osx.dmg and follow the instillation steps.

This is what I have installed:

The following components are installed:
Android SDK
    +Android SDK Base 24.2.0
    +Android Platform Tools 22.0.0
    +Android Build Tools 22.0.1
    +Android 4.4.2(API 19) 4.4.2
    +Android 5.0 (API 21) 5.0.1
    +Android SDK Support Library 22.2.0
    +Android SDK Support Repository Library 15
Android Toolchain
    +Android NDK 10e
    +Apache Ant 1.8.2
    +Gradle 2.2.1

4 Developing a game

Please see my tutorial on UnrealEngine 4.

5 Packing it up for Android

5.1 Package Configuration

Once you have completed designing the game do the following:

Open Plugins

Package configuration

Package configuration

Then, make sure you have enabled the following:

Package configuration

Package configuration

Next open your Project Settings..., Go to Target Hardware and do the following:

Target hardware

Target hardware

Then do this:

Project Settings Menu

Project Settings Menu

Then do the following:

Android Platform

Android Platform

Then do this:

Android Platform

Android Platform

And then this:

Android Platform SDK

Android Platform SDK

5.2 Packing

Do the following:

Packing

Packing

6 Installing it on Android

Note 3: Make sure you have connected your phone before proceeding.

Open Android_ETC2 folder and double click on Install_GearVR-UnrealEngine4_Development-armv7-es2.command, this will open Terminal and install the software for you.

Copyright © Akshay Raj Gollahalli's logo 2019