Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ZebraAi Tester

A minimal .NET MAUI sample app that demonstrates how to integrate the Suntech.KazamCaptureAI NuGet package into an Android application.

This project is the reference integration example for Suntech's ZebraAi SDK — it shows the complete usage pattern from initialization to result handling in just a few files.


Requirements

Platform Android 11+ (API 30)
Target device Zebra With AI
.NET .NET 10 (MAUI)
IDE Visual Studio 2022 17.12+ or JetBrains Rider

The app runs only on Android. The project structure is cross-platform MAUI but the SDK is Android-only.


Getting Started

1. Clone and open

git clone https://github.com/suntech/ZebraAiTester.git
cd ZebraAiTester

Open ZebraAiTester.csproj in Visual Studio or Rider.

2. Restore NuGet packages

dotnet restore

This pulls Suntech.KazamCaptureAI and its two satellite model packages automatically:

  • Suntech.KazamCaptureAI.ZebraBarcode (~108 MB) — barcode localizer model
  • Suntech.KazamCaptureAI.ZebraOcr (~197 MB) — text OCR recognizer model

First restore may take a few minutes due to the model sizes.

3. Configure the license

Open Platforms/Android/Services/ZebraAiServiceAndroid.cs and set the LicenseJwt field:

// Use "DEMO" for demo mode (results are partially masked with asterisks)
private static readonly string LicenseJwt = "DEMO";

// Use a real JWT for production (contact info@suntechonline.it)
// private static readonly string LicenseJwt = "eyJ...";

In DEMO mode the app works on any device without a license — scan results are partially replaced with * characters to indicate the demo limitation.

To obtain a production license, send your device serial numbers to info@suntechonline.it:

adb shell getprop ro.serialno

4. Deploy to a Zebra device

Connect your Zebra device via USB and run:

dotnet build ZebraAiTester.csproj -f net10.0-android36.0 -t:Run

Project Structure

ZebraAiTester/
├── MainPage.xaml              # UI — scan buttons and result display
├── MainPage.xaml.cs           # Button handlers and result formatting
├── Platforms/
│   └── Android/
│       └── Services/
│           └── ZebraAiServiceAndroid.cs   # SDK wrapper (async/Task API)
└── ZebraAiTester.csproj       # Project file with NuGet reference

The entire integration is contained in ZebraAiServiceAndroid.cs — a single static helper class that wraps the Kotlin SDK callback model into a clean C# Task<IList<ZebraAiResult>> API.


How It Works

Initialization

The SDK is initialized once when the main page appears:

ZebraAiScanner.Initialize(context, LicenseJwt);

Starting a scan

A scan is started by calling ZebraAiScanner.Scan() and bridging the Kotlin callback to a TaskCompletionSource:

var results = await ZebraAiServiceAndroid.ScanAsync(
    activity,
    RecognitionMode.Ocr,
    SelectionMode.Automatic);

The scanner opens a fullscreen overlay on the device camera. The user points the camera at the target and the SDK returns results automatically (or after user confirmation, depending on the selection mode).

Recognition modes

Mode Description
Barcode Reads 1D/2D barcodes (Code 128, QR, Data Matrix, PDF417, and 40+ more)
Ocr Reads printed or embossed text using the AI OCR model
Both Reads barcodes and text simultaneously

Selection modes

Mode Description
Automatic Returns the first recognized item immediately
Accumulate Lets the user collect multiple items; confirms with "SEND ALL"
Manual Freezes the frame and lets the user tap the item to send

OCR confidence filter

The UI exposes a slider (0–100%) to set a minimum OCR confidence threshold. Items below the threshold are discarded before being returned to the app:

cfg.OcrFilter.MinConfidencePercent = 75; // discard results below 75% confidence

Set to 0 to disable filtering and receive all results regardless of confidence.

Result format

Each ZebraAiResult exposes:

Property Type Description
Value string The decoded text or barcode value
Type ResultType Barcode or Ocr
Symbology string? Barcode symbology (e.g. "Code128") — null for OCR
Confidence float Recognition confidence in [0, 1]

NuGet Package

This app consumes the SDK via NuGet. The only reference needed in your .csproj is:

<PackageReference Include="Suntech.KazamCaptureAI" Version="1.0.3" />

NuGet automatically resolves the two satellite model packages as transitive dependencies.

For more details on the full API, see the Suntech.KazamCaptureAI README.


License

This sample project is provided by Suntech Srl for integration reference purposes.
The ZebraAi SDK itself is a commercial product — see the NuGet package license for details.

For support or licensing inquiries: info@suntechonline.it

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages