适用于 Android 的 EIS 快速入门
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
- 设置开发环境以使用电子防抖功能。
- 在示例应用中体验防抖相机预览。
打开示例项目
本快速入门使用 OpenGL,这是一个用于渲染 2D 和 3D 矢量图形的编程接口。在开始执行以下步骤之前,请先查看启用 ARCore。
使用以下命令克隆代码库以获取示例项目:
git clone https://github.com/google-ar/arcore-android-sdk.git
在 Android Studio 中,打开位于 arcore-android-sdk
目录下的 samples
子目录中的 hello_eis_kotlin 示例项目。
运行示例
借助 HelloEIS 示例应用,您可以在受支持的设备上为相机预览切换防抖功能。
确保您的 Android 设备已连接到开发机器,然后点击 Android Studio 中的 Run
。
如果设备缺少 Google Play 面向 AR 的服务 或该服务版本过旧,设备可能会提示您安装或更新该服务。点按 CONTINUE 即可从 Google Play 商店安装该应用。
切换 EIS
点按齿轮图标,然后选择 Electronic Image Stabilization (EIS) 即可开启/关闭 EIS。选择 Enable EIS 即可启用 EIS。
![]()
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eThis guide provides steps to set up your development environment for Electronic Image Stabilization (EIS) using a sample project that leverages OpenGL for rendering.\u003c/p\u003e\n"],["\u003cp\u003eYou can experience the stabilized camera preview by running the provided HelloEIS sample app on a supported Android device with ARCore enabled.\u003c/p\u003e\n"],["\u003cp\u003eThe sample app allows you to toggle EIS on or off through a settings menu, letting you compare the stabilized and unstabilized camera feeds.\u003c/p\u003e\n"]]],[],null,["# EIS quickstart for Android\n\n- Set up your development environment for Electronic Image Stabilization.\n- Experience the stabilized camera preview in a sample app.\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_eis_kotlin** sample project, located in the `samples` subdirectory within the `arcore-android-sdk` directory.\n\nRun the sample\n--------------\n\nThe HelloEIS sample app lets you toggle the image stabilization for camera preview on supported devices.\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\nToggle EIS\n----------\n\nTap the gear icon and select **Electronic Image Stabilization (EIS)** to toggle EIS on/off.\nSelect **Enable EIS** to enable EIS."]]