开始在 Android 设备上使用相机和媒体
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
相机和媒体应用涵盖广泛的使用场景,从拍摄内容到编辑照片,再到与朋友分享音乐,以及在社交媒体上浏览视频。在此开发者中心,您可以找到相关资源,帮助您针对这些类型的用例及更多用例创建、扩展、升级和优化应用。
目前,您可以在本部分中找到有关媒体播放和视频编辑的指南,但随着时间的推移,相机和媒体开发者中心将不断扩充,纳入有关应用内拍摄和其他相关用例的内容、打造多设备体验时的最佳实践,以及示例应用代码的直接参考,以便您了解所有这些内容在实际应用中的效果。
本部分还提供了有关如何向应用添加相机功能的指南,无论您是想通过启动 intent 来启动用户喜爱的相机应用,还是想直接在应用中构建完整的相机功能,都可以参考本部分。
构建应用
如需构建音频或视频播放功能,我们建议使用 Jetpack Media3 库中的 ExoPlayer。
创建播放应用
如需构建媒体编辑功能,我们建议使用 Jetpack Media3 库中的 Transformer。
创建编辑应用
扩大应用的覆盖范围
通过添加对更多设备规格(例如大屏设备、Wear OS 设备、Google 助理和支持 Cast 的设备)的支持,在用户所处的任何位置触达他们。
前往“扩大应用的覆盖范围”
提升应用水平
通过实现 HDR 和空间音频等优质媒体功能,让您的应用从优秀变得更好,最终达到最佳水平。然后,通过多设备集成提高互动度和收入。
前往“升级应用”页面
针对高画质进行优化
通过测试并投资于性能和可靠性,确保用户在使用您的应用时获得出色的体验。
前往“优化高画质”
向应用添加相机功能
通过将应用与用户偏好的相机应用集成,或直接在应用中添加完整的相机功能,使应用能够拍摄照片和视频。
前往“添加相机功能”
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-18。
[null,null,["最后更新时间 (UTC):2025-08-18。"],[],[],null,["# Get started with camera and media on Android\n\nCamera and media apps span a broad range of use cases, from capturing content to\nediting photos to sharing music with friends to scrolling through videos on\nsocial media. In this developer center, you'll find resources to help you\ncreate, extend, level up, and optimize your apps for these types of use cases\nand more.\n\nCurrently, you will find guidance for media playback and video editing in this\nsection, but over time the Camera and media developer center will grow to\nincorporate content for in-app capture and other relevant use cases, best\npractices as you build multidevice experiences, and direct references to sample\napp code so you can see it all in action.\n\nThis section also provides guidance on how to add camera capabilities to your\napp, whether by firing off an intent to launch the user's favorite camera app,\nor by building full camera capabilities directly into your app.\n\nBuild an app\n------------\n\nTo build audio or video playback features, we recommend using ExoPlayer from the\nJetpack Media3 library.\n\n[Create a playback app](/media/implement/playback-app)\n\nTo build media editing features, we recommend using Transformer from the Jetpack\nMedia3 library.\n\n[Create an editing app](/media/implement/editing-app)\n\nExtend your app's reach\n-----------------------\n\nReach your users where they are by adding support for more form factors like\nlarge screens and Wear OS, Google Assistant, and Cast-enabled devices.\n\n[Go to Extend your app's reach](/media/implement)\n\nLevel up your app\n-----------------\n\nTake your app from good, to better, to best by implementing premium media\nfeatures like HDR and spatial audio. Then, drive higher engagement and revenue\nwith multidevice integrations.\n\n[Go to Level up your app](/media/grow)\n\nOptimize for high quality\n-------------------------\n\nEnsure users have a great experience when using your app by testing and\ninvesting in performance and reliability.\n\n[Go to Optimize for high quality](/media/optimize)\n\nAdd camera capabilities to your app\n-----------------------------------\n\nEnable your app to capture photos and videos,\neither by integrating your app with the user's\npreferred camera app, or by adding full camera capabilities directly into\nyour app.\n\n[Go to Add camera capabilities](/media/camera/get-started-with-camera)"]]