Overview
This sample application is only intended for educational purposes, demonstrating the use of DataWedge intent API(s).
Free-Form Image Capture allows an image of any form (not restricted to a document or label) to be captured by either the built-in internal imager or camera with the option to highlight and/or decode any barcode present. The capability for the internal imager to capture an image is useful if there is no built-in camera on the device. When capturing images from the camera, the image resolution is 1920 x 1080.
This sample app performs the following:
- Registers a broadcast receiver to listen for DataWedge intents.
- Creates a DataWedge profile named "FreeFormImageCaptureProfile" if it does not exist and retrieves the result from the broadcast receiver. The profile includes the following configurations:
- Enables Free-Form Image Capture under Workflow Input.
- Enables Intent Output and sets the intent action, category and delivery mechanism to broadcast.
- Associates the sample app to the "FreeFormImageCaptureProfile" profile.
- When scanning a barcode from any image, the data is captured and displayed with the image and decoded data.
Requirements
APIs Used
DataWedge API |
App Functionality |
Create Profile |
Create the profile with specific parameters for Free-Form Image Capture. |
Delete Profile |
Delete the profile if creating the profile fails. |
Get Profiles List |
Get the list of DataWedge profiles on the device to check if a profile exists. |
Set Config |
Set the appropriate configurations specified. |
Soft Scan Trigger |
Start/stop or toggle the software scan trigger. |
Using This Sample
Download and build the sample app.
Copy and install the sample app to the device.
Launch the sample app.
- DataWedge profile “FreeFormImageCaptureProfile” is created if it does not exist.
- If profile creation fails, the profile is deleted. Tap Re-create profile to attempt to recreate the profile.
Tap Start Scanning or press the hardware trigger button to start the scan.

When a barcode is detected within the viewfinder, it is highlighted.

Capture the image by pressing the trigger button.
- If a barcode is detected within the image captured, the decoded data along with the captured image is displayed.
- If no barcode is detected, only the image is displayed.

Tap Clear Scan Data to clear the data displayed.
Related guides: