[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eRun the \u003cstrong\u003ehello_ar_kotlin\u003c/strong\u003e or \u003cstrong\u003ehello_ar_java\u003c/strong\u003e sample app to get started using ARCore with Android, utilizing OpenGL for rendering 2D and 3D graphics.\u003c/p\u003e\n"],["\u003cp\u003eSet up your development environment by installing Android Studio and the Android SDK, and cloning the ARCore SDK GitHub repository to access the sample projects.\u003c/p\u003e\n"],["\u003cp\u003ePrepare your device or emulator by ensuring it supports ARCore and updating Google Play Services for AR if necessary.\u003c/p\u003e\n"],["\u003cp\u003eUtilize features like Instant Placement to place AR objects without waiting for surface detection, and Depth to enable realistic occlusion of virtual objects by real-world objects.\u003c/p\u003e\n"],["\u003cp\u003eExplore additional resources like sample projects, codelabs, and design guidelines to further your AR development journey with ARCore.\u003c/p\u003e\n"]]],["To start with ARCore on Android, clone the ARCore SDK GitHub repository in Android Studio, and open either the **hello_ar_kotlin** or **hello_ar_java** sample project. Ensure your device or emulator has Google Play Services for AR updated. Run the app, which uses OpenGL to display detected planes. Tap on a plane to place a 3D model. Enable Instant Placement to allow immediate object placement that refines as the user moves. Depth can be enabled for realistic object occlusion.\n"],null,["# Quickstart for Android\n\nTo get started using ARCore with Android, you can run either the\n**hello_ar_kotlin** or **hello_ar_java** sample app included with the ARCore\nSDK. These sample apps use [OpenGL](https://en.wikipedia.org/wiki/OpenGL), a\nprogramming interface for rendering 2D and 3D vector graphics. The apps display\nany detected planes and allow the user to tap on a plane to place a 3D model.\n\nSet up your development environment\n-----------------------------------\n\n- Install [Android Studio](https://developer.android.com/studio/index.html)\n version 3.1 or higher with Android SDK Platform version 7.0 (API level 24)\n or higher.\n\n- If you are new to Android, see\n [Building your first Android app](https://developer.android.com/training/basics/firstapp/index.html).\n\nOpen a sample project\n---------------------\n\n1. In Android Studio, clone the ARCore SDK GitHub repository.\n\n There are many ways to do this:\n - For an established Android Studio installation:\n\n - From the **Git** menu, select **Clone**.\n - In the **Version control** drop-down, select **Git** as the version control system.\n - In the **URL** field, enter the following URL to the ARCore GitHub\n repository:\n\n **https://github.com/google-ar/arcore-android-sdk.git**\n - You can also open a **Terminal** and issue the `git clone` command as\n follows:\n\n ```\n git clone https://github.com/google-ar/arcore-android-sdk.git\n ```\n2. Open one of the sample projects as follows (you must explicitly open a\n project in order to build and run it).\n\n - From the **File** menu, select **Open**.\n - In the **arcore-android-sdk/samples** folder, select either the **hello_ar_kotlin** or **hello_ar_java** folder, and click **Open**.\n\nPrepare your device or emulator\n-------------------------------\n\nYou can run AR apps on a [supported device](/ar/devices) or\nin the Android Emulator. You must update Google Play Services for AR\non the emulator before running the app. See\n[Run AR Apps in Android Emulator](/ar/develop/java/emulator#update-arcore) for more\ninformation.\n\nRun the sample\n--------------\n\nMake sure your Android device is connected to the development machine and click\n**Run** in Android Studio.\n\nAndroid Studio builds your project into a debuggable APK, installs the APK, and\nthen runs the app on your device. For more information, see\n[Build and Run Your App](https://developer.android.com/studio/run/index.html).\n\nYou may be prompted to install or update [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. Select **CONTINUE** to install it from\nGoogle Play Store, or manually update it as described in\n[Update Google Play Services for AR](/ar/develop/java/emulator#update-arcore).\n\nThe **hello_ar_java** app lets you place a three-dimensional ARCore pawn on\ndetected AR plane surfaces. It is implemented with [Android GL SurfaceView](https://developer.android.com/reference/android/opengl/GLSurfaceView),\nwhich is used to render the camera preview and basic AR objects such as Planes\nand Anchors. **hello_ar_java** 's sample rendering framework can be found in\n[`com/google/ar/core/examples/java/common/samplerender`](https://github.com/google-ar/arcore-android-sdk/tree/master/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender).\n\n| **Note:** The lifecycle methods in **hello_ar_java** are different than those normally found in OpenGL applications. To ensure the correct AR setup for your own applications, follow the lifecycle management logic in **hello_ar_java**.\n\n### Use Instant Placement\n\nThe [Instant Placement API](/ar/develop/instant-placement) allows the user to place an AR object on the screen without having to wait for ARCore to detect surface geometry. Object placement is refined in real time as the user moves further around the environment.\n\nTap on the screen to place an object. Make sure to continue moving the device\naround after seeing the holographic object appear on screen, so that ARCore can\nget sufficient data about your surroundings to accurately anchor the virtual\nobject.\n\nOnce ARCore detects the surface geometry and establishes a trackable in the\nregion where the object is placed, the object's pose is automatically updated\nfor accuracy.\n\nIn Figure 1, Instant Placement is disabled and surface geometry is undefined.\nObjects placed on the floor to the right of the pool table (four small blue dots)\nappear knocked-over, their poses are undefined.\n\nIn Figure 2, Instant Placement is enabled from the menu under the gear icon.\n\nIn Figure 3, with Instant Placement enabled, a new object is placed in the scene.\nIt appears in grayscale, instead of colored, to denote that it has not been\ncorrected for an accurate pose yet.\n\nIn Figure 4, the new object becomes colored, and its pose is accurate, when the\nsurface geometry (described by the *trackable* grid lines) is detected.\n\n### Use Depth\n\nWhen [Depth](/ar/develop/depth) is enabled, ARCore takes into account the geometry and location of objects in the scene, and computes the location of\nobjects placed in the scene relative to other objects in the scene. It allows\nplaced objects to be occluded by objects in the scene, and lends realism to\nyour app.\n\nIn Figure 1, Depth is disabled. An object is placed under the pool table.\n\nIn Figure 2, as the device moves around the pool table, the object appears\nto follow the device irrespective of objects in the scene.\n\nIn Figure 3, Depth is enabled.\n\nIn Figure 4, the object now appears occluded by the pool table as the device\nmoves around the scene.\n\nNext steps\n----------\n\n- Try building and running other [sample projects](https://github.com/google-ar/arcore-android-sdk/tree/master/samples) in the ARCore SDK.\n- Check out the [Augmented Reality codelabs](https://codelabs.developers.google.com/?category=ar) for more sample apps that you can build and run.\n- Learn how to [Enable ARCore](/ar/develop/java/enable-arcore) in your app.\n- Review the [Runtime Considerations](/ar/develop/java/runtime).\n- Review the [Design Guidelines](/ar/develop/developer-guides/design-guidelines)."]]