contact Us
whatsapp icon
AR with 3D objects in Android
AR VR Development

AR with 3D objects in Android

Written By

Nikhil Solanki

Mobile Lead at Manek Tech

Updated

March 13, 2024

Read

3 Min

Table of Contents

ARCore , augmented reality (AR) will deploy the digital objects into the real world system via camera interface. ARCore, enabling experiences that are more natural, interactive UI/UX support and helpful. You can add 3D objects in the real world system and interact with those, how it looks if they were present in real life.

We will learn how to build 3D objects and deploy using the ARCore feature provided by Google.

Set up your development environment

  1. Android Studio version 3.1 or higher with Android SDK Platform version 7.0 (API level 24) or higher
  2. You can run AR apps on a supported device or in the Android Emulator
  3. OpenGL ES 3.0 or higher required
  4. Android Emulator 27.2.9 or later
  5. Clone the google sample application from

git clone: https://github.com/google-ar/sceneform-android-sdk.git

Add AR dependency com.google.ar.sceneform:core:1.15.0 to use the predefined functions to manipulate the objects easily.

Declare the information for the AR as below. You can make AR features optional or required by declaring a value flag inside the meta-data. This will affect the application visibility inside the Google Play Store. If value=" **optional**"then application will be displayed to all the devices even if they are not supporting the AR feature. value=" **required**"then Google Play will display applications only to the devices which have the AR feature.

Android Manifest to declare AR Optional for the application:

   

App with AR Support compulsorily:

Check whether ARCore is supported

Check Google Play Services for AR is installed or not

App must call ArCoreApk.requestInstall() to check if Google Play Services is installed or not.

Open the demo system ‘solarsystem’ available inside the samples folder. Import the project inside Android Studio. Please take note that .sfb file is a 3d model representation file.

Add ArSceneView for showing Augmented view in layout file

Build all the planet models.

Build a renderable from a 2D View.

ARCore’s motion tracking technology uses the phone’s camera to identify interesting points, called features, and tracks how those points move over time. With a combination of the movement of these points and readings from the phone’s inertial sensors, ARCore determines both the position and orientation of the phone as it moves through space.

Set an update listener on the Scene that will hide the loading message once a Plane is detected.   

ARCore looks for clusters of feature points that appear to lie on common horizontal or vertical surfaces, like tables or walls, and makes these surfaces available to your app as planes. ARCore can also determine each plane’s boundary and make that information available to your app. You can use this information to place virtual objects resting on flat surfaces.

Place the solar system once detect the plane surface

        // Create solar system using the nodes

Create planet individual

Using ARCore Sceneform , a 3D framework that makes it easy for Java developers to build ARCore apps without OpenGL.

ARCore’s understanding of the real world lets you place objects, annotations, or other information in a way that integrates seamlessly with the real world. You can place a napping kitten on the corner of your coffee table, or annotate a painting with biographical information about the artist.

Create planet function

After this, the camera will detect the surface and place the solar system objects will be visible on the surface. You can Touch objects for information and zoom in or out according to your preference. You can also move the phone close to the object or move to any direction to see the planets in 3D in front of you.

Need Expert Guidance?

Talk to our experts and get recommendations tailored to your project.

About the Author

Nikhil Solanki

Mobile Lead at Manek Tech

Nikhil Solanki has 10+ years of experience in App Development and currently works as the Mobile Lead at ManekTech. He is an experienced Mobile lead with a demonstrated history of working in Mobile's information technology and services industry.

More articles on the topic

Mobile App Development Firebase Analytics In Mobile App

An app's user base using Firebase Analytics, a free and unlimited analytics solution. You'll be able to learn who your users are and how they interact with your app.

7 Min ReadFeb 27, 24

Nikhil Solanki

Nikhil Solanki

Mobile Lead at Manek Tech

DevOps Consider These Top 4 Data Visualization Tools

Data Visualization technologies provide us with a proliferation of insights into the data obtained. Google and Microsoft, for instance, gather and utilize Big Data to shape the future of their commercial operations.

4 Min ReadFeb 29, 24

Ruchir Pandya

Ruchir Pandya

Delivery Head of Web at Manek Tech