This React Native project implements a simple camera application that allows users to capture an image of food, overlay the app's logo, add a hardcoded macro description, and save the modified image to the device's storage.
-
Camera Functionality:
- Implement the camera functionality to capture an image.
-
Add Logo and Macro Description:
- Overlay a logo of the app on the captured image.
- Add a hardcoded macro description of the food (e.g., "Protein: 10g, Carbs: 20g, Fat: 5g").
- Ensure the position of the logo and macro description on the image is visually appropriate.
-
Save Image to Device Storage:
- Save the modified image (with the logo and macro description) to the device storage.
-
UI/UX:
- Provide a simple and clean UI for capturing the image and displaying the result.
- Include basic navigation if needed.
Follow these steps to run the Simple Camera App on your local machine or device:
- Clone the repository:
git clone https://github.com/yourusername/simple-camera-app.git
cd simple-camera-app
- Install dependencies using Yarn:
yarn install
- Start the Expo development server:
yarn start
For initializing aes build: https://docs.expo.dev/eas-update/getting-started/
For creating apk: https://docs.expo.dev/build-reference/apk/
login and run
yarn build-android
-
Overlay Implementation:
- Uses
react-native-view-shot
to capture the view containing the app’s logo and the hardcoded macro description overlaid on the captured image. Positioning is adjusted based on the image dimensions for visual clarity.
- Uses
-
Storage Functionality:
- Utilizes
expo-file-system
to save the processed image to the device's local storage. Handles any errors that may occur during the saving process to ensure data integrity. - Uses
expo-media-library
to save the image to the user's photo album.
- Utilizes