
Get ready for the next computing platform
On thursday 12 December 2024, The Android invited developers and journalist in New York to present what looks like the future of Android: Android XR.
Android XR is a variation of our beloved Android OS for Smart Glasses and Mixed Relality headset. The same day, on the same stage, Samsung demoed their implementation of Android XR. The demo included Google Maps, Gemini, Google Chrome and other third-party partners close to Google such as Calm.
Set up your environment
You will need a set of tools to get started with Android XR. The Android Team has already released everything your need to start. You will need to download approximately 5GB, get your WiFi on and download!
First, you will need to download and install the Android Studio Meerkat Canary 5 or later.

Launch Android Studio Meerkat and head to File > New > Project

Select XR on the left and then Basic Headset Activity in the right panel.

Click next and from there customise your app name.
Select Android 34 as minimum SDK for now (to match the emulator)

Click the Gradle Sync icon (or Sync Now).
This will download the dependencies for you, including Android XR Compose, XR Material design, the SDK 34…

Job Offers
Next we need to run our App. For this the Android Team provides a new XR Emulator.


Select the device manager and create a new virtual device. In the window select XR on the left panel and XR device in the right panel.

Select Google Play XR System image (make sure the architecture maches you computer (ARM / Intel).

It will take a few minutes to download the Emulator image.
Goooo,
Your emulator is downloaded, you are now ready and set to go and run the sample app on your shiny new XR emulator, click that green button!

Now that you are all set, try to load your other projects and run them on your XR emulator. If your app is responsive and work properly on foldables and tablets, you should be able to enjoy a decent experience without modifying much. Look at the Android Developer News app:

Next steps
I highly encourage you to clone the XR sample that show more implementation details.
Stay tuned as I will share more articles on Android XR in the next few days, you can follow me to make sure you don’t miss anything.
I hope the Android Team will soon offer a way to run XR on our phones with a Cardboard or Daydream-like device, so that Android Developers can experience the feel of the apps they develop.


This article is previously published on proandroiddev.com.