Android Development Software Setup
This guide describes how to install and set up Android Studio and all the essential tools that you’ll use to build VR apps, including:
- Android Studio IDE (recommended IDE)
- Android Platforms
- Android SDK tools
- Android NDK
If you’re planning to use a Mac for development, first install
Xcode. If you’re using another platform you can skip this installation.
After installing Android Studio, you can install the following packages:
- Android SDK Platform, API level 26
- Android SDK Build Tools, v 28.0.3 or later
- Android NDK
These packages are installed through the Android SDK Manager. To access the manager:
- Open Android Studio.
- Click the three vertical dots icon on your top right corner.
- Click the SDK Manager icon (
).
Alternatively, load an existing project and navigate to Tools > SDK Manager or click the SDK Manager icon on your top right corner.
Verify Installation of Correct Packages and Versions At this point, you must verify that you have installed all the correct packages and versions.
- In the Settings window that is open, under Android SDK Manager, select the SDK Platforms tab.
- If you are building for Meta Quest, verify that Android 8.0 (Oreo) is installed, as it is the minimum version required by the Oculus SDK.
- If Android 8.0 (Oreo) is missing, select the checkbox next to its name and click Apply to install it.
- Select the SDK Tools tab.
- Verify that the NDK (Side by side) toolset, CMake, and the Android SDK Build Tools 28.0.3 (or later) are all installed.
- If they are missing, select them and click Apply to install them.
Once you’ve finished installing the required packages, you can configure your development environment.
Android Studio Project Structure To verify your settings in Android Studio, open an existing project or create a new one, and navigate to File > Settings > Project Structure > SDK Location.
If present, verify that the following properties are set to the appropriate values:
- Android SDK location
- Android NDK location
Make note of these locations, as you’ll use them to set your environment variables in the next section. If Android NDK location is missing, locate the ndk
folder and its latest version, typically under C:\Users\[username]\AppData\Local\Android\Sdk\ndk\[versionnumber]
as you will use that path too.
Environment Variables and Path With the locations recorded in the previous step, set the following environment variables:
- Set the environment variable JAVA_HOME to the JDK location, typically
C:\Program Files\Android\Android Studio\jre
. - Set the environment variable ANDROID_HOME to the Android SDK location, typically
C:\Users\[username]\AppData\Local\Android\Sdk
. - Set the environment variable ANDROID_NDK_HOME to the Android NDK location, typically
C:\Users\[username]\AppData\Local\Android\Sdk\ndk\[versionnumber]
. - Add the JDK tools directory to your PATH, typically
C:\Program Files\Android\Android Studio\jre\bin
. - Add the Android SDK platform-tools directory to your PATH, typically
C:\Users\[username]\AppData\Local\Android\Sdk\platform-tools
. - Add the Android SDK tools directory to your PATH, typically
C:\Users\<username>\AppData\Local\Android\Sdk\tools
.
Setting up your System to Detect your Android Device (Windows Only)
You must set up your system to detect your Android device over USB in order to run, debug, and test your application on an Android device.
You may need to install a USB driver for ADB after installing the Android SDK. The driver and installation instructions can be found on the
Downloads page.
Windows may automatically detect the correct device and install the appropriate driver when you connect your device to a USB port on your computer.
Access the Device Manager through the Windows Control Panel. If the device was automatically detected, it will show up under Portable Devices in the Device Manager. Otherwise, look under Other Devices in the Device Manager and select the device to manually update the driver.
To see the list of detected attached devices, enter the following at a command prompt:
Note: You will need to successfully set up your Android development environment in order to use this command.
If the device does not show up, verify that the device is turned on with enough battery power and that the driver is installed properly.