Set up your development environment
Install Android Studio version 3.0 or higher with Android SDK Platform version 7.0 (API level 24) or higher.
You will need to get the ARCore SDK for Android. You can either:
Download the ARCore SDK for Android and extract it.
Clone the repository with the following command:
git clone https://github.com/google-ar/arcore-android-sdk.git
You will need a basic understanding of Android development with OpenGL. If you are new to Android or OpenGL development, see the following tutorials:
Prepare your device or emulator
You can run AR apps on a supported device or an emulator.
- To prepare a physical device, Enable developer options and USB debugging
- To prepare an emulator, see Run AR Apps in Android Emulator.
Open the sample project
In Android Studio, open the HelloAR sample project in
<ARCore SDK Folder>/samples/hello_ar_java.
The sample project has build dependencies on certain versions of software, such as Gradle and the Android SDK. If the required dependencies are not installed, Android Studio will ask you for permission to download and install them on your machine.
Run the sample
Make sure your Android device is connected to the development machine and click Run in Android Studio. Then, choose your device as the deployment target and click OK.
Android Studio builds your project into a debuggable APK, installs the APK, and then runs the app on your device. For more information, see Build and Run Your App.
You may be prompted to install or update the ARCore app if it is missing or out of date. Select CONTINUE to install it from Google Play Store.
As you move your device, the app automatically detects flat surfaces and draws a diamond grid. Tap the grid to place an Android robot on the surface.
Learn how to Enable ARCore in your app.