[PAID] MlTBRek: Offline Text and Barcode recognition using ML Kit [$8 or 551]

By dmin
[PAID] MlTBRek: Offline Text and Barcode recognition using ML Kit [$8 or 551]

The MlTBRek extension for App Inventor 2 and Kodular enables offline text recognition and barcode scanning using ML Kit. This extension offers modules for barcode and text recognition, including support for various scripts such as Latin, Devanagari, Chinese, Japanese, and Korean. Users can initialize text and barcode recognizers, install and check the availability of necessary modules, and recognize text or barcodes from images, file paths, or content URIs. The extension also provides events for handling module states, recognition results, and errors, making it a powerful tool for integrating advanced recognition features into your apps.

1. Overview

  • Offline text and barcode recognition using Google ML Kit.
  • Support for multiple language scripts: Latin, Devanagari, Chinese, Japanese, and Korean.
  • Initialize text and barcode recognizers separately.
  • Install, check availability, and release ML modules as needed.
  • Recognize text or barcodes from Image components, file paths, or content URIs.
  • Live barcode scanner with camera preview support.
  • Detailed events for module states, recognition results (with structured data), and error handling.
  • Automatic parsing of QR Codes, Data Matrix, PDF-417, and Aztec values into structured formats (URL, contact, WiFi, geo, email, phone, SMS, calendar, driver license).

Latest Version: 5
Published: 2023-09-02T18:30:00Z
Last Updated: 2026-06-21T18:30:00Z
Aix size: 1.3 mb
Permissions: android.permission.CAMERA android.permission.READ_MEDIA_IMAGES

2. Blocks

MlModules

Text Recognizer

image
image
401×536 15.7 KB

image
image
396×279 8.48 KB
Barcode Recognizer

image
image
572×712 24.4 KB

image
image
590×779 28.8 KB

image
image
485×258 4.71 KB

3. Example Usage

Install required modules:
Use the InstallModules block with the appropriate type (e.g., text or barcode). The ModulesInstalled event fires when installation succeeds; otherwise ModulesInstallFailed fires with an error message. You can also check module availability with CheckModulesAvailability – the GotModulesState event returns whether modules are available.

Text Recognition:

  1. Initialize the text recognizer by calling InitTextRecognizer with a language script constant (e.g., DefaultScript, DevanagariScript).
  2. Provide an input image to the RecogniseText block. The input can be an Image component, a file path, or a content URI.
  3. If successful, the RecognisedText event fires with the recognized text and a list of block dictionaries. Each dictionary contains: text (complete text), lines (list of lines), angles (list of angles per line), and confidences (list of confidence values). If recognition fails, TextRecognitionFailed fires with an error message.

Barcode Recognition:

  1. Initialize the barcode recognizer with InitBarRecognizer.
  2. Provide an input image to the RecogniseBarcode block (same input types as text).
  3. Depending on the barcode type, specific events are fired: UrlScanned, ContactInfoScanned, EmailScanned, WifiScanned, GeoPointScanned, PhoneScanned, SmsScanned, CalendarEventScanned, DriverLicenseScanned. If no specific type matches, BarcodeScanned fires with raw value and format. If scanning fails, BarRecognitionFailed fires with an error message.

Live Scanner:

  1. Set the camera preview container using SetPreviewContainer (pass a component like a Canvas).
  2. Call StartScanner to begin scanning. Results are delivered via the same events as above.
  3. Call StopScanner to stop the live camera.

Note: Camera permission (android.permission.CAMERA) is required for live scanning.

4. Demo Video

5. Changelog

Version 2 — 2023-10-26
  • Rename extension to MlTBRek from SimpleRecognition

  • Some new blocks added and few blocks removed

  • Upgrade to ML Kit
    Brings dynamic deps management and thus effectively reducing aix size to just 1.1mb

  • Major internal changes wherever there was room for improvement
    Like support for Hindi and other Devanagari Script langs

  • Recognise blocks can accept Image component, File Path or Content Uri

  • Completely offline purchase verification

Version 3 — 2024-05-04
  • Aix size reduced to 1.1 mb
  • Extension won't crash Companion now
    Though none of its blocks will work.
  • No-conflict version to resolve deps conflict with my other ML Kit extensions like ImageLabelling and ScanKit
Version 4 — 2024-08-30
  • Extension has been completely re-written so create a backup of imp projects before importing new version

  • Added Chinese, Japanese and Korean language script supported to extension

  • Updated Text Recognition (19.0.1) and Bar Recognition (18.3.1) SDKs

  • Added license key property so no need to upload license to assets now

Version 4.1 — 2025-12-04
  • Online images can also be used now

Simply pass the image url.

image

Input:
image

Result:

image

Version 5 — 2026-06-22
  • Architectural Modularization Split the monolithic extension into three specialized components (BarcodeRecognizer, TextRecognizer, MlModules) to keep your projects clean and reduce overhead.

  • New Live Camera Scanner Added full support for continuous live barcode scanning through a camera preview (SetPreviewContainer, StartScanner, StopScanner blocks).

  • Added CloseRecognizer methods to give you explicit control over freeing up ML Kit resources.

Thank you.
Hope it helps!