Home/Blog/Programming/Building augmented reality applications: An introductory guide
Home/Blog/Programming/Building augmented reality applications: An introductory guide

Building augmented reality applications: An introductory guide

Syed Ibrahim Ghaznavi
Jan 11, 2024
4 min read
share

Become a Software Engineer in Months, Not Years

From your first line of code, to your first day on the job — Educative has you covered. Join 2M+ developers learning in-demand programming skills.

Augmented reality (AR) allows computer-generated virtual objects to be superimposed onto the real world to enhance the user's perception of reality. Hardware to experience AR, such as a head-mounted display (HMD) or a handheld mobile device, is needed to experience AR. HMD-based AR experiences generally require expensive hardware, and thus they are less scalable than hand-held smartphone-based AR experiences. 

Participant wearing an AR head-mounted display
Participant wearing an AR head-mounted display

The AR experience typically requires a camera and a display device to capture the real-world environment and to overlay the digital content onto it in real-time simultaneously. AR has a variety of applications in gaming, entertainment, education, advertising, and e-commerce. 

Several mainstream industries are employing augmented reality. It's one of the prime drivers of the internet of the future: Web 3. Through advanced 3D AR visualizations, it is now possible to imagine how a product would look in real- life before purchasing it. Most top brands are harnessing AR to enhance their customer experience. Some of the most widely used AR applications are as follows:

  • IKEA Place: This app lets shoppers project additional items in their real-world homes, allowing users to see whether the new items will suit their needs. The app can be used to virtually decorate a room with IKEA furniture before purchasing items.

  • Snapchat: This is one of the most popular AR applications that let users alter their appearance and also add virtual objects to their environment.

  • Apple's Facetime: Apple's Face Time is another popular application that harnesses AR to alter the facial appearance of users.

  • PokemonGO: This is a popular AR game that quickly became a global phenomenon. The players use their mobile devices to explore their surroundings and look for cute collectible 3D Pokémons. It's a location-based AR experience that uses GPS and the camera of the player's device to create an augmented reality experience in which players can see and interact with Pokémons. It encourages its users to get outside, exercise, and explore their local communities.

  • Google Translate: This popular Google product uses AR to translate text in real time using a smartphone's camera.

  • MeasureKit: It is an app that allows us to measure objects in the real world using our smartphone's camera.

There are two major categories of AR technology.

  1. Marker-based: This AR experience only begins when the marker (an image or an object) is detected.

  2. Markerless AR: This AR experience is not subject to the detection of the marker.

The Markerless AR further has four subcategories:

  1. Overlay AR: Used to overlay additional information onto real-world objects.

  2. Contour-based AR (or outline-AR): Adds additional information to facilitate the user with a task. An example could be an AR application highlighting the boundaries of the roads for the driver, thus making them more prominent in an underground tunnel with poor lighting conditions.

  3. Projection-based AR: Involves projecting light onto flat surfaces to create 3D imagery.

  4. Location-based AR: The AR content is fixed with a specific physical location. The user must be at a particular spot to launch the AR experience.

Types of markerless AR
Types of markerless AR

These are exciting times for AR developers due to the massive adoption of AR technologies globally, so it’s important to get started with learning AR development. This blog will provide essential guidance to program your first basic markerless AR experience and run it on your Android phone. The following are the steps that will need get the app running:

  1. Install Unity Hub

    1. From within the Unity Hub, install the latest Unity LTS version

    2. Enable Android support during installation

  2. Create a new project by clicking the "New project" button

    1. Select the AR core project

  3. Once the project is loads, you need to go to "File">"Build Settings.\"

    1. Select Android and press 'Switch Platform' as shown in Slide 1 below.

    2. Press the "Player Settings" button in the same window (Slide 2) and fill in change the following:

      1. "Company Name" with any name of your choice

      2. "Scripting Backend" from "Mono" to "IL2CPP"

      3. Enable "ARM64"

      4. Uncheck "Multithread Rendering"

      5. Set the "Minimum API Level" to "24"

      6. Uncheck "Auto Graphic API"

      7. Remove "Vulkan" from the list because it does not support AR core

  4. Now add a 3D model such as the Cube in the scene (Slide 3).

  5. Build and run ("File">"Build And Run") the app on your device. Ensure that you:

    1. Connect your Android phone to your machine via an Android cable

    2. Enable the developer mode on your Android phone. (Slide 4)

    3. Enable the USB debugging on the phone (Slide 5)

  6. Move the camera around, and you should be able to see an AR object (the cube) in the scene (Slide 6)

    1. Permit the AR application to access the camera (Slide 6)

1 of 6

If you enjoyed building your first AR application, there are several specialized courses that will bring you up to speed with the latest AR, VR, and MR development tools and techniques. Check out our course catalog for more fun AR and VR learning products! Or you can start learning about data science and machine learning with Educative in order to transform digital environments.


  

Free Resources