android/camera-samples

Public

Multiple samples showing the best practices in camera APIs on Android.

  • Stars5.5k+1 tuần này
  • Forks2.4k
  • Watchers204
  • Issues112
  • Ngày tạo06/05/2019
  • Cập nhật gần nhất11/08/2026
  • Ngôn ngữKotlin
  • Giấy phép—
README.md11.2 KBRaw

Android Camera Samples Catalog

A single, stand-alone Android app that showcases the Camera2 and CameraX APIs through a catalog of small, self-contained, Compose-first samples. Each sample focuses on one feature and reuses a shared camera-scaffolding layer, so adding a new sample means writing the feature — not the boilerplate.

Screenshots

The home catalog in the "Console" theme — a violet accent, monospace metadata, a bordered featured card, and a dense 2-column grid. The filter pills narrow the catalog by category, and samples are grouped CameraX-first, Camera2 below.

Home catalog — all samples     Home catalog — the ML category

How to run

  1. Clone the repository.
  2. Open it in a recent Android Studio.
  3. Run the app configuration on a device or emulator. Camera-dependent samples (extensions, slow-motion, ML) behave best on a physical device; emulators with a virtual camera cover the basics.

No Firebase / google-services.json is required.

Samples

Filter the catalog by category (Images / Video / ML / Graphics / Extensions / Controls) on the home screen. Within each view, CameraX samples are listed first and Camera2 below.

Sample API What it shows
Take a Photo CameraX / Camera2 Preview, tap-to-focus, capture a still
Take a Video CameraX (Recorder) / Camera2 (MediaRecorder) Record video to DCIM/Camera
Pause/Resume CameraX (Recorder) Pause and resume a recording mid-capture
Slow Motion Camera2 High-speed (constrained) recording
HDR Video CameraX / Camera2 Record & play back 10-bit HDR video (DynamicRange / DynamicRangeProfiles)
Video Stabilization CameraX Steadier footage via preview + video stabilization
Flip While Recording CameraX Switch front/back cameras without interrupting the recording
QR Scanner CameraX / Camera2 + ML Kit Real-time barcode/QR detection with overlay
Image Labeling CameraX + ML Kit Real-time on-device labels via ImageAnalysis
Luminosity CameraX Scene-brightness meter from the ImageAnalysis Y plane
Green Screen CameraX + ML Kit Concurrent cameras: segment the front-camera subject over the live back camera

Nội dung README thuộc về android và cộng đồng đóng góp, giấy phép Không có giấy phép. Nguồn: github.com/android/camera-samples