Simple Camera App

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.

Requirements

  1. Camera Functionality:

    • Implement the camera functionality to capture an image.
  2. 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.
  3. Save Image to Device Storage:

    • Save the modified image (with the logo and macro description) to the device storage.
  4. UI/UX:

    • Provide a simple and clean UI for capturing the image and displaying the result.
    • Include basic navigation if needed.

How to Run the Project

Follow these steps to run the Simple Camera App on your local machine or device:

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/simple-camera-app.git
cd simple-camera-app
  1. Install dependencies using Yarn:
yarn install
  1. Start the Expo development server:
yarn start

Build:

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

Implementation Details

Overlay and Storage Functionality

  • 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.
  • 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.