Native capabilitiesIntermediate5h

Camera & media.

Photos, video, and the media library on device.

What is camera and media access?

Many apps capture or pick images and video — avatars, posts, document scans. The camera and media-library APIs let you take photos, record video, and select existing media, then handle the resulting files for display or upload.

Why it matters

Camera and media features are extremely common and touch several hard topics at once: permissions, large files, platform differences, and uploads. Getting them working smoothly is a frequent real-world requirement and a good test of whether you can combine the skills from earlier stages.

What to learn

  • Launching the camera versus picking from the library
  • Handling the captured file: URI, type, size
  • Image manipulation: resizing and compression
  • Uploading media to a backend
  • Permissions for camera and library
  • Handling large files and memory
  • Platform differences in pickers

Common pitfall

Uploading full-resolution photos straight from the camera. Modern phone images are many megabytes, so uploading raw is slow, costly, and can run the app out of memory. Resize and compress before upload to a sensible dimension and quality — the user rarely needs the original resolution.

Resources

Primary (free):

Practice

Build a flow that lets the user take a photo or pick one from the library, resize and compress it, preview it, and upload it to a backend. Handle the camera permission first. Done when the uploaded image is compressed rather than the multi-megabyte original.

Outcomes

  • Capture from the camera and pick from the library.
  • Handle the resulting media file and preview it.
  • Resize and compress before uploading.
  • Combine permissions, files, and uploads in one flow.
Back to Mobile roadmap