Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon

Create Your First Augmented Reality Experience Using the Programming Language You Already Know

Save for later
  • 7 min read
  • 13 Feb 2017

article-image

This post gives a short summary of the different ways to get AR up and running with the tools available in different programming languages. We will outline the advantages and drawbacks of specific solutions.

Pick your language and follow along. We will introduce the tools that you will need.

I know Objective-C

This one is for iPhone and iPad users only and requires a Mac. The weapons of choice would be Vuforia, one of the industry leaders, or Kudan, a bit of an up-and-comer and sometimes a bit unprofessional when it comes to maintaining their website, but the tech is solid. Both frameworks allow you to code in Objective-C. In order to do so, download and install Xcode. You will also need an Apple Developer Program membership, which comes at 99 USD per year. This is necessary to install your own app on your own phone or tablet. You can ask your school or university, a lot of them are Apple partners by now and provide free access. Read this guide to get the basics of building and running an iPhone app on an iOS device out of the way.

create-your-first-augmented-reality-experience-using-programming-language-you-already-img-0

After this, head over to the Vuforia download area and download the Vuforia SDK and what they call the samples for Core Features for iOS. You need to sign up for a free Vuforia Developer account beforehand. Extract both ZIP files and open the folders side by side, and then copy the samples folder into the SDK folder, as shown in the image. Open VuforiaSamples.xcodeproj in Xcode. Press Command + B to build and run with your iOS device connected. The first try will fail because, by default, the project’s code signing is messed up. Click on the error message and follow the Fixing Instructions. After that, build and run again. It will succeed and launch the app on your device.

However, if you try one of the sample screens in the app, it will tell you that the license key is missing. Head to the developer portal, generate a free Development license key , and add it to the code of your app. Open the file SampleApplicationSession.mm and look for this line:

Vuforia::setInitParameters(mVuforiaInitFlags,””);

And, replace with it the following:

Vuforia::setInitParameters(mVuforiaInitFlags,”<YOUR_KEY_HERE>”);

Save, build, and run.

The trigger images are located in the media folder, which is part of the unzipped samples folder. Just pull one up on the screen and follow the instructions in the app. You get a nice little tea pot, which has been the default 3D example visualization for the past decades.

create-your-first-augmented-reality-experience-using-programming-language-you-already-img-1

I know Java

Hold on to your Android phone… or tablet. This one is easy; you can use any PC running Windows or Linux or a Mac. You need Android Studio. Android can be very tricky when it comes to actually building and running your app because the IDE can run on so many different operating systems. Take a look at this excellent tutorial if you need to, and circle back here once you have your first Android app up and running. After that, head over to the Vuforia download area and download the Vuforia SDK and what they call the samples for Core Features for Android. You need to sign up for a free Vuforia Developer account beforehand. After that, the steps are identical to the one outlined in the previous section (I know Objective-C).

Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at $19.99/month. Cancel anytime

I know Swift

Ask again later.

Sorry. As AR is basically an extension of computer vision, it is hugely reliant on running complex algorithms as often as possible every second (30 FPS minimum). Thus, most frameworks are built with earlier generation programming languages, which are closer to the metal and allow for more optimization. No AR framework provides examples or tutorials written in Swift today.

I know JavaScript

Wikitude is for you. Their approach is to offer a native SDK for iOS and Android. The SDK then provides an interface that allows you to create AR views with JavaScript only. Wikitude just released version 6 of their SDK, adding support for SLAM Instant Tracking. The features and software quality are good. The development version will display a watermark. Download the JavaScript SDK here. There’s also a native SDK that can be programmed with Objective-C or Java, very similar to Vuforia.

I know C++

Use Android NDK in combination with Vuforia for Android. Alternatively, use Xcode and Objective-C, again combined with Vuforia because the sample code provided there is actually Objective-C++ code (Objective-C with C++ mixed in).

I know C# (a.k.a. I know Unity 3D)

Unity 3D is a game engine and authoring environment for 2D and 3D interactive experiences. If you are not familiar with any of the programming languages above, it will be much more efficient to dive into Unity 3D. It allows you to code in C# backed by the .Net framework (well, its open source cousin called mono). This provides a good API, and Unity 3D allows you to publish the same code to Android, iOS, and PC without much modification. Of course, handling a 3D engine and authoring environment has its very own challenges, but all in all, it will still be much more efficient to learn Unity 3D than to learn Objective-C/Xcode and Java/Android Studio at the same time. There’s a nice guide available here on how to use Unity 3D and Vuforia with a comprehensive set of samples. Please note that you will always need Xcode and an Apple Developer Program account, even if you use Unity 3D.

I don’t know any of the programming languages

You can sign up with Augment, Blippar, or WakingApp. All three allow you to create AR experiences with the help of a more or less user-friendly online editor. You can upload your own content and create some basic interactions. After that, you can run it in the company’s respective AR Viewer App available for mobile devices. The overall process for this is more often than not pretty bumpy and the results are severely limited. However, it’s a good way to get a taste and try AR first hand if you don’t know how to code. In case you are already working with professional design tools, such as Unity 3D, you can head over to vuframe.com and signup there. It offers the same as any of the three tools mentioned above (and more) and is targeted at professional users. You can publish professional AR with a single click.

Summary

At this point, if you have tried one of the coding approaches and have never created an app before, you will be exhausted. Creating AR experiences with today’s technology is exhausting because you spend at least as much time on preparing the underlying infrastructure (the mobile app) as you spend on designing and implementing your AR experience. This is a significant obstacle on the road to large-scale AR adoption—for now.

About the Author

Andreas is the founder and CEO at Vuframe. He’s been working with augmented and virtual reality on a daily basis for the last 8 years. Vuframe’s mission is to democratize AR and VR by removing the tech barrier for everyone.