Camera Blocks

Overview

The camera blocks provide functionalities to interact with the device's camera. These blocks enable users to capture images or record videos directly within the app.

Advanced Blocks

Each block in the camera blocks drawer has a regular and advanced block. To access the advanced version of a block:

  1. Add the block to your workspace.

  2. Right-click on it.

  3. Select Show advanced block.

Outputs

The advanced blocks return an "error" output block. If there is an error when executing the block, the error block will return an error message. If not, the error block will return a null value.

Photo from Camera

The "photo from camera" block opens the device's camera and allows the user to take a photo. The photo can then be used in the app.

Regular Block

Advanced Block

Output NameData TypeFunction

photo

image

If a photo was taken, returns the photo.

was cancelled

true/false

Returns whether the user cancelled taking the photo.

error

text

If there was an error, returns the error.

Video Tutorial

How to Use the Device’s Camera in a Thunkable App

In this tutorial, you’ll use Thunkable camera app features to create an app that takes a photo with the device's camera.

Image Recognition

The "description of image from" block generates a description of a given image. This block requires internet access.

This component is powered by Microsoft Azure. You can get your own server URL and subscription key for Microsoft Azure here. You can add these details to your app in the Project Settings panel, which you can access by clicking on your app icon.

Regular Block

Advanced Block

OutputData TypeFunction

description

text

Description of the image.

tags

list of text

Returns tags used to identify the image.

confidence level

number between 0 and 1

Returns calculated confidence level that the given description is accurate.

error

text

If there was an error, returns the error.

Video Tutorial

How to Create an Image Recognition App with Thunkable

In this tutorial, you’ll use Thunkable camera app features to create an app that takes a photo with the device's camera and utilizes image recognition functionality to identify the photo’s content.

Barcode or QR Code Scanner

The "barcode scanned using camera" block scans a barcode or QR code and returns its value.

Regular Block

Advanced Block

OutputData TypeFunction

value

text

Value of scanned barcode/QR code.

type

text

Returns whether it was a barcode or QR code that was scanned.

was cancelled

true/false

Returns whether the user cancelled scanning a code.

error

text

If there was an error, returns the error.

Video Tutorial

How to Use the Device’s Camera as a QR or Barcode Scanner in a Thunkable App

In this tutorial, we’ll add the functionality to scan a barcode or QR code with the device's camera.

Template App

  1. Click Copy Project in the upper right.

Record Timed Video

The "video file from [5] second recording using [back] camera" block opens the device's camera and films from the selected camera for the chosen amount of time and then returns the video file.

Regular Block

Advanced Block

InputData TypeFunction

Number of Seconds

Number

Set how long to record for.

Using [...] Camera

Select from menu

Select camera to record with (front or back).

OutputData TypeFunction

videoFile

Video file

The recorded video footage.

error

Text

If there is an error, returns the error. Else returns NULL.

Record Untimed Video

The "video file from recording using [back] camera" block opens the device's camera and films from the selected camera until the user ends the recording using the controls on the device's camera. It returns the video file.

Regular Block

Advanced Block

InputData TypeFunction

Using [...] Camera

Select from menu

Select a camera to record with (front or back).

OutputData TypeFunction

video file

Video file

Returns the recorded video footage.

Error

Text

If there is an error, returns the error. Else returns NULL.

Video Tutorial

How to Use the Device’s Video Camera in a Thunkable App

In this tutorial, you’ll use Thunkable camera app features to create an app that records a video with the device's camera.

Last updated