Virtual and Augmented reality, the next big thing in Android

Ameen Shokoya
Antaeus AR
Published in
7 min readSep 29, 2023
Photo by Minh Pham on Unsplash

Picture a world like the one depicted in the sci-fi blockbuster Ready Player One or the epic space opera of Star Wars, where entire landscapes materialize before our eyes and digital realms blend seamlessly with reality. My friends, this is not just the future but the present. Virtual Reality (VR) is no longer confined to science fiction; it’s becoming integral to our daily lives.

This article will journey through the captivating world of Virtual and Augmented reality. Follow along!

INTRODUCTION

Virtual Reality (VR) is a technology that immerses users in a computer-generated, three-dimensional (3-D) environment completely separate from the physical world. It typically involves wearing a specialized headset that covers the user’s field of vision and often includes headphones for immersive audio.

In a VR environment, users can interact with and explore this computer-generated world as if they were physically present within it. VR is commonly used in gaming, simulations, training scenarios, etc., to create deeply immersive and interactive experiences.

Augmented Reality (AR) is a technology that overlays computer-generated information, such as images, text, or 3D models, onto the real-world environment, enhancing the user’s perception of their surroundings. It is typically experienced through our smartphone/tablet’s camera, heads-up displays (HUDs) in vehicles, smart glasses, etc.

Unlike VR, AR does not replace the real world but supplements it with digital elements, making it a valuable tool for fashion, education, and navigation, enhancing day-to-day activities.

EVOLUTION OF VR AND AR

Virtual Reality (VR) and Augmented Reality (AR) have undergone remarkable transformations over the decades. VR’s origins can be traced back to the mid-20th century when early attempts were made to create immersive computer-generated environments. However, it wasn’t until the 1980s that the term “virtual reality” was coined, as advancements in computer technology allowed for more convincing simulations. VR found applications in various domains, including gaming and medical training.

Augmented Reality (AR), on the other hand, has a history dating back to the 1960s, when computer scientist Ivan Sutherland developed the first head-mounted display system. AR gained prominence in the 1990s, with initial uses in industrial settings. Over time, it expanded into entertainment, navigation, and education, offering users real-time digital information superimposed onto their physical surroundings.

INTEGRATION WITH ANDROID

Android, the world’s most popular mobile operating system, has played a pivotal role in popularizing VR and AR technologies. As a driving force behind Android, Google has been at the forefront of these efforts.

In 2014, Google introduced Google Cardboard, a groundbreaking concept that turned ordinary smartphones into VR devices. By placing a smartphone into a Cardboard headset, users could experience basic VR environments at a fraction of the cost of high-end VR headsets.

Around the same time, Google launched Google Tango, an ambitious project to bring advanced AR capabilities to Android devices. Tango-equipped smartphones feature specialized sensors for precise motion tracking and 3D environmental mapping, pushing the boundaries of AR experiences.

In 2017, Google introduced ARCore, marking a significant step in bringing AR to mainstream Android devices. ARCore provided developers with the tools to create AR apps that could run on a wide range of Android smartphones, making AR more accessible to users worldwide.

Additionally, Google ventured into high-end VR with “Daydream VR,” offering a more immersive VR experience through specially designed headsets and controllers.

These milestones in Android’s integration of VR and AR have paved the way for developers to create innovative applications that leverage these technologies to enhance user experiences. As a result, VR and AR have become more accessible and widespread, transcending traditional boundaries and finding applications in various industries.

Here are some steps to creating an Android app that integrates VR:

/* Sample code showing how to create 
* a VR project in Android
*/

// Import Gradle dependencies and sync
dependencies {
// ...
implementation 'com.google.vr:sdk-base:1.20.0'
implementation 'com.google.vr:sdk-audio:1.20.0'
implementation 'com.google.vr:sdk-controller:1.20.0'
implementation 'com.google.vr:sdk-video:1.20.0'
}
/* Next, create a new Kotlin class named "VrActivity" 
* that extends the "GvrActivity" class from the Google VR SDK.
* Override the "onCreate" method and set up the VR view.
*/

import android.os.Bundle
import com.google.vr.sdk.base.GvrActivity
import com.google.vr.sdk.base.GvrView

class VrActivity : GvrActivity() {
private lateinit var gvrView: GvrView

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

gvrView = GvrView(this)
setContentView(gvrView)
}
}
/* To render the VR content, you need to create a new Kotlin class 
* that implements the "GvrView.StereoRenderer" interface.
* We will define the 3D objects, textures,
* and shaders to display in the VR scene in this class
*/

import android.opengl.GLES20
import com.google.vr.sdk.base.GvrView

class VrRenderer : GvrView.StereoRenderer {

// Initialize your 3D objects, textures, and shaders here

override fun onNewFrame(headTransform: HeadTransform) {
// Update the 3D objects based on the head orientation
}

override fun onDrawEye(eye: Eye) {
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT or GLES20.GL_DEPTH_BUFFER_BIT)

// Render the 3D objects for the left or right eye
}

override fun onFinishFrame(viewport: Viewport) {
// Perform any final cleanup or post-processing
}

override fun onSurfaceChanged(width: Int, height: Int) {
// Update the OpenGL viewport to match the screen size
}

override fun onSurfaceCreated(config: EGLConfig) {
// Initialize the OpenGL resources needed for rendering
}

override fun onRendererShutdown() {
// Release any OpenGL resources before the renderer is destroyed
}
}
// Finally, we set the renderer for our VR activity

class VrActivity : GvrActivity() {
private lateinit var gvrView: GvrView
private lateinit var vrRenderer: VrRenderer

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

gvrView = GvrView(this)
vrRenderer = VrRenderer()
gvrView.setRenderer(vrRenderer)
setContentView(gvrView)
}
}

Now, we can run our VR app on a compatible Android device or emulator.

HARDWARE & SOFTWARE REQUIREMENTS

To use VR/AR in Android devices, various hardware and software requirements must be met:

Hardware Sensors

  • Accelerometer: Measures acceleration and helps track device movement
  • Gyroscope: Provides orientation information and aids in 360-degree tracking.
  • Magnetometer: Helps detect the device’s orientation relative to the Earth’s magnetic field.
  • Light Sensor: Adjusts screen brightness based on ambient light conditions.
  • Proximity Sensor: Detects when an object is close to the screen.
  • GPS: Enables precise location tracking for AR-based navigation.

Furthermore, Android apps also request permissions for various system features such as camera, location, and sensors.

DEVELOPMENT TOOLS

To develop VR/AR applications, various tools and programming can be used. Some of the languages are but not limited to C#, C++, Rust, Java, and Kotlin (that are used in Android development). Popular IDEs (Integrated Development Environments) are Unity3D, Google AR Core, etc.

POPULAR APPLICATIONS

VR/AR is integrated into most apps we use today. Some of them are Facebook, YouTube, Google Earth, and others.

POSSIBLE FUTURE TRENDS

  • Wireless and Standalone Devices: VR and AR will likely involve more wireless and standalone devices. This reduces the reliance on tethered connections and opens up opportunities for untethered, mobile experiences.
  • Mixed Reality: The lines between VR and AR are blurring, giving rise to mixed reality (MR). MR combines elements of both VR and AR, allowing digital and physical worlds to coexist seamlessly. This can revolutionize fields like education, training, and gaming.
  • 5G Connectivity: The rollout of 5G networks will significantly enhance the capabilities of VR and AR. Low latency and high bandwidth will enable more immersive and responsive experiences, particularly in remote applications like telemedicine and collaboration.
  • AI Integration: Artificial intelligence (AI) will play a crucial role in the future of VR and AR. AI-driven algorithms can enhance object recognition, natural language processing, and gesture recognition, making interactions in virtual and augmented spaces more intuitive.
  • Healthcare and Education: VR and AR have enormous potential in healthcare for training, therapy, and remote consultations. These technologies can provide interactive and immersive learning experiences in education, making complex concepts more accessible.
  • Social VR/AR: Social interactions within virtual and augmented spaces are growing. Platforms that enable people to meet, work, or play together in these environments are gaining popularity.
  • Accessibility: As technology matures, there’s a growing emphasis on making VR and AR more accessible to all users, including those with disabilities. This includes improved interfaces, voice commands, and haptic feedback.
  • Environmental Integration: Future trends may see AR applications deeply integrated into our physical surroundings, providing real-time information, navigation, and contextual assistance seamlessly.

CHALLENGES

  1. Hardware Requirements: One of the ongoing challenges in the VR and AR space is the need for powerful hardware. High-resolution displays, advanced sensors, and powerful processors are essential for creating immersive experiences. However, this can limit the accessibility of VR and AR to users with high-end devices.
  2. Content Development: Creating compelling and engaging content for VR and AR remains challenging. Developers must adapt to new design principles and techniques to optimize user experiences in these immersive environments.
  3. Motion Sickness: Motion sickness is a common issue in VR, where the brain perceives motion that doesn’t correspond to physical movement. This can lead to discomfort and limit the duration of VR experiences.
  4. Interoperability: Ensuring that VR and AR content and applications work seamlessly across different devices and platforms can be complex. Interoperability challenges can hinder the growth of the ecosystem.
  5. Privacy and Security: AR applications that use real-world data, such as location and facial recognition, raise privacy concerns. Striking a balance between utility and safeguarding user data is a significant challenge.

CONCLUSION

In summary, Virtual Reality (VR) and Augmented Reality (AR) are poised to be the next significant Android advancements. These technologies have a rich history of evolution, from their inception to their integration with Android devices. Google’s contributions, such as Google Cardboard, Tango, ARCore, and Daydream VR, have played a pivotal role in making VR and AR accessible to a broader audience.

As we peer into the future, the trends in VR and AR promise to reshape our interaction with technology. Wireless and standalone devices, mixed reality, 5G connectivity, AI integration, and applications in healthcare and education are all on the horizon. However, challenges such as hardware requirements, content development, and privacy concerns must be addressed.

VR and AR offer boundless possibilities in this ever-evolving landscape, blurring the lines between the digital and physical realms. They are not just technologies but gateways to new, immersive experiences. The next big thing in Android is unfolding, inviting us to explore, learn, and connect in previously unimaginable ways.

If you like this article, follow me on Twitter to catch up with me for more tech-related content. You can also give me a clap and leave comments below to let me know what you think.

--

--

Ameen Shokoya
Antaeus AR

App developer and IT professional. Loves computers. Skilled in technical support and currently building Android apps with Jetpack Compose.