skip to content

How to Create Camera & Video App

There are Following App Designing Steps….

1. Set Up the Project

  • Open MIT App Inventor and start a new project:
    • Go to MIT App Inventor.
    • Click on “Projects” and select “Start New Project.”
    • Name your project (e.g., CameraVideoApp).

2. Design the User Interface

  1. Add Components:

    • Drag a Button1 to the screen from the User Interface palette and set the text to “Capture Image.”
    • Set Height and Width of the Button
    • Drag another Button2 and rename it with the text “Record Video.”
    • Add an Image1 component to display captured images. 
    • Add a Label to display messages .
  2. Layout:

    • Select “VerticalArrangement” from Layout Pallete.
    • Set Height & Width “Fillparent”.

3. Add Media Components

  • Add a Camera Component:
    • Drag the Camera component from the Media palette into the workspace. This component will be used to capture images. 
  • Add a Video Recorder Component:
    • Drag the VideoRecorder component from the Media palette into the workspace.

4. Block Coding of Camera & Video App

  • Switch to the Blocks Editor by clicking on the “Blocks” tab.

1. Record Video Button Click:

    • From Button1 drawer, drag out a when Button1.Click block.

 

    • From the Camcoder1 drawer, drag out a call Camcoder1.RecordVideoblock and place it inside the click event like this.

    • From the CamCoder1 drawer, drag out a when CamCoder1.AfterRecordingblock

 

    • From the VideoPlayer1 drawer, drag out a set VideoPlayer1.Sourceblock and attach a get clip with it.

 

    • Now Complete Block of CamCoder1. 

 

2.Image Capture Button Click:

    • From Button2 drawer, drag out a when Button2.Click block.

    • From the Camera1 drawer, drag out a call Camcoder1.TakePictureblock and place it inside the click event like this.

    • From the Camera1 drawer, drag out a when Camera1.AfterPictureblock

    • From the Image1 drawer, drag out a set Image1.Pictureblock and attach a get Image with it.

5. Test the App

  • Connect your Android device to the MIT App Inventor companion app.
  • Test the app by clicking the “Capture Image” and “Record Video” buttons.