This is a Camera application built with React Native, Expo Camera, and Media Library. The app allows users to capture and save photos to their device.
- Capture photos using the device camera
- Save photos to the device's media library
- View the last saved photo
- Zoom in and out
- Toggle flash and torch
- Switch between front and back cameras
- Animated shutter effect
- React Native
- Expo
- Expo Camera
- Expo Media Library
- @react-native-community/slider
CameraView: This component from Expo Camera is used to display the camera view.useCameraPermissions: This hook is used to request and check camera permissions.usePermissionsfrom Expo Media Library: This hook is used to request and check media library permissions.Button: Custom button component to handle various camera actions.
-
Clone the repository:
git clone https://github.com/khaoulasdevtutos/CameraApp.git cd CameraApp -
Install dependencies:
Make sure you have
npxinstalled. Then, install the project dependencies:npx expo install
-
Run the app:
Start the Expo development server:
npx expo start
You can then open the app in an emulator or on a physical device using the Expo Go app.
-
Grant Permissions:
- When the app first loads, it will request camera and media library permissions. Grant the necessary permissions to proceed.
-
Capture a Photo:
- Use the camera view to capture a photo by pressing the capture button.
-
Save a Photo:
- After capturing a photo, you can save it to the device's media library.
-
View Last Saved Photo:
- The last saved photo will be displayed, and you can view it by pressing the preview button.
- Ensure you have a physical device or a simulator with camera functionality to test the application.
- This project demonstrates the integration of camera functionality in a React Native app using Expo.