Posted in Gaming Technology

Augmented Reality Project with Unity and Vuforia

Introduction

This article will explain how to use Unity and Vuforia to make an Augmented Reality app for your Android device.  As a beginner, this is where I had some problems.  To create the Android app was as simple as recompiling the Unity project for the Android platform.  The app failed to build on Android Studio.  The next problem, the app would not switch to the video after detecting the targets.

Basically, the application uses photos of the Seattle Seahawks’ logo and Russell Wilson as target images.  When the app detects the target, the app switches to the videos of the Hawks famous plays.

The application worked with Unity 2017.4.1.f1 and Vuforia SDK v7.1.34.  This article does not cover running the Unity and Vuforia on the Windows 10 desktop, because “Playful Technology” already has an awesome video on youtube.

 

Unity and Vuforia Tutorial on Windows 10

There is no way I could explain it better.  The author from “Playful Technology” does an excellent job.  The video was published February 2018.  As of April 2018, this was one of the latest tutorials.

https://www.youtube.com/watch?v=MtiUx_szKbI&t=748s

Unity and Vuforia are changing their software a lot.  I started out trying the make the app based on a tutorial from September 2017, but it was out of date.

Devices used

Windows 10 PC, Galaxy Tablet A.  Android version 7.1.1.

The Unity and Vuforia Project

The project is real simple.  I am using photos of Seahawks’ logo and of Russell Wilson as my targets. These 2 photos were added to “Target Manager” database from the Vuforia website.,  After you create the database, import it into Unity.  When you run Unity, the AR camera detects the targets, and the app shows the Seahawks monumental plays.  GO HAWKS!!

 

Unity and Vuforia Tutorial on Android

The 2 problems I encounter were;

  • The project would not build for Android
  • Videos attached to the markers would not play.

SOLUTION

For any problems with the app check Unity website first.  A lot of information is under the Unity “Community” link.  Both of the solutions were found under “Forums” and “Answers” which is under the link.

The Build Problem

The Unity/Vuforia project failed to build with jdk-9.0.1.  The Unity Forum explained how to fix the problem in Android Studio, by changing the jdk-1.8.0_131.  Yo do this by loading the Unity *.apk project into Android Studio.  Then go to File > Project Structure and change the SDK setting as shown and change the jdk-1.8.0_131.


The Video Transcoding Problem

The next problem was the app was not switching to the video after it detected the targets.  The video had to be transcoded and compressed.  Without transcoding the video, the Android device was not able play the video.  The video had to be compressed so it can run on the Android device.  The original size of the Android executable was 126 MB.  Transcoding and compressing the video cut the size down to 66 MB.

Video Of the App running in Unity And Vuforia on Windows and Android

Leave a Reply