[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eExplore Google's Depth API by setting up your development environment and running a sample application.\u003c/p\u003e\n"],["\u003cp\u003eExperience real-world occlusion of virtual objects using ARCore's depth capabilities on supported Android devices.\u003c/p\u003e\n"],["\u003cp\u003eVisualize and understand how the depth map works by enabling the visualization feature within the sample app.\u003c/p\u003e\n"],["\u003cp\u003eLearn how to enable depth for more realistic AR experiences and access further resources on implementing Depth API.\u003c/p\u003e\n"]]],[],null,["# Depth API quickstart for Android\n\n- Set up your development environment for Depth API\n- Try out occlusion and visualize the depth map in a sample app\n\nPrerequisites\n-------------\n\n- [Android Studio](https://developer.android.com/studio/) version 3.1 or higher with Android SDK Platform version 7.0 (API level 24) or higher\n- An Android device that supports depth. See the list of [supported devices](/ar/discover/supported-devices) for details.\n- A basic understanding of Android development. If you are new to Android, see [Building your first Android app for beginners](https://developer.android.com/training/basics/firstapp/index.html).\n- A basic understanding of the Depth API. If you are new to working with Depth, see the [Depth API overview](/ar/develop/depth).\n\nOpen the sample project\n-----------------------\n\nThis quickstart uses [OpenGL](https://en.wikipedia.org/wiki/OpenGL), a\nprogramming interface for rendering 2D and 3D vector graphics. Review\n[Enable ARCore](/ar/develop/java/enable-arcore) before getting started with the\nfollowing steps.\n\nGet the sample project by cloning the repository with the following command: \n\n```\ngit clone https://github.com/google-ar/arcore-android-sdk.git\n```\n\nIn Android Studio, open the **hello_ar_java** sample project, located in the\n`samples` subdirectory within the `arcore-android-sdk` directory.\n\nRun the sample\n--------------\n\nThe Depth API sample app lets you place virtual Android figures in your\nenvironment, and toggle occlusion to see the difference. It also lets you toggle\nthe depth map visualization in a given space.\n| **Note:** The Depth API is not supported when running in the Android Emulator. Use a physical [supported device](/ar/discover/supported-devices) to test the Depth API.\n\nMake sure your Android device is connected to the development machine and click\n**Run** in Android Studio.\n\nYour device may prompt you to install or update\n[Google Play Services for AR](https://play.google.com/store/apps/details?id=com.google.ar.core)\nif it is missing or out of date. Tap **CONTINUE** to install it from the\nGoogle Play Store.\n\nEnable depth\n------------\n\nThe first time you run the app and place an Android figure, a dialog will prompt\nyou to enable depth. It only appears the first time the app is run, for the\nfirst Android placed. Tap **Enable** to add occlusion.\n\nToggle occlusion and a visualization of the depth map\n-----------------------------------------------------\n\nTap the gear icon to toggle occlusion and a visualization of the depth map.\nSelect **Enable depth** to enable occlusion. Select **Show depth map** to\ndisplay a visualization of the depth map on the device's screen.\n\nFor example, the following images show a virtual Android figure in a real space\ncontaining a trunk beside a door. In the first image, the virtual Android\nunrealistically overlaps with the edge of the trunk. In the second image,\nthe Android is properly occluded, appearing much more realistic in its\nsurroundings.\n\nThe following images show a camera image of a hallway with a bicycle on the\nwall, and a visualization of the depth map that is created for that camera\nimage.\n\nNext steps\n----------\n\nStart using the Depth API in your own apps. To learn more, see:\n\n- [Depth API overview for Android](/ar/develop/java/depth/overview)\n- [Depth API developer guide for Android](/ar/develop/java/depth/developer-guide)\n- [ARCore SDK for Android API reference](/ar/reference/java)\n- [Use the ARCore Depth API for immersive augmented reality experiences](https://codelabs.developers.google.com/codelabs/arcore-depth) (codelab)."]]