Camera, Photos & Media
Capture photos and video, pick from the library, scan barcodes, and process and upload media efficiently.
Intermediate · about 6 hours · difficulty 3/5
Learn first: Runtime Permissions & Privacy
Camera and media features appear in a huge range of apps: profile pictures, receipts, document scanning, QR codes and social posts.
Building blocks
- Image picker: let users choose from their library or take a quick photo with the system UI (expo-image-picker, image_picker, Photo Picker on Android,
PhotosPickeron iOS). The modern system pickers often need no library permission at all. - Custom camera for in-app capture with overlays: expo-camera or react-native-vision-camera, the camera package in Flutter, CameraX on Android, AVFoundation on iOS.
- Barcode and QR scanning is built into most camera libraries.
- Audio and video playback with expo-video/expo-audio, video_player, Media3/ExoPlayer or AVPlayer.
Processing and upload
- Phone photos are large; resize and compress before upload (expo-image-manipulator, platform APIs).
- Strip or respect EXIF data (location metadata is a privacy issue).
- Upload with progress, in the background if large, and retry on failure. Pre-signed URLs to object storage avoid routing files through your API.
Pitfalls
Loading many full-resolution images into memory crashes low-end phones. Use thumbnails and an image library with caching.
Good enough to move on: users can pick or take a photo, crop and compress it, and upload it with a progress indicator.
Key concepts
- System image picker
- Custom in-app camera
- Barcode and QR scanning
- Resizing and compressing images
- EXIF metadata and privacy
- Uploads with progress
- Audio and video playback
Mini project
Build a receipt scanner that captures a photo, compresses it, uploads it to your BaaS storage and shows a gallery of past receipts.
Check yourself
Why should you compress a photo on the device before uploading it?
Free resources
- Expo ImagePicker (Expo)
- Expo Camera (Expo)
- CameraX overview (Android Developers)