CheapBarcodes.Scanning 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package CheapBarcodes.Scanning --version 1.0.0
                    
NuGet\Install-Package CheapBarcodes.Scanning -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CheapBarcodes.Scanning" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CheapBarcodes.Scanning" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CheapBarcodes.Scanning" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CheapBarcodes.Scanning --version 1.0.0
                    
#r "nuget: CheapBarcodes.Scanning, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CheapBarcodes.Scanning@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CheapBarcodes.Scanning&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CheapBarcodes.Scanning&version=1.0.0
                    
Install as a Cake Tool

CheapBarcodes.Scanning

RT150 handheld barcode scanner integration for Android, UI-agnostic. Wraps the CN.Pda serial-port SDK (via CheapBarcodes.Binding) plus the vendor broadcast fallback behind two small types:

  • IHardwareScannerService / AndroidHardwareScannerService — scan event stream with beep + vibration feedback (NullHardwareScannerService for non-Android targets).
  • Rt150ScannerHost — activity-lifecycle host for the scan thread and receivers.

Usage

Register the service (MAUI shown; any Android DI works):

#if ANDROID
builder.Services.AddSingleton<IHardwareScannerService, AndroidHardwareScannerService>();
#else
builder.Services.AddSingleton<IHardwareScannerService, NullHardwareScannerService>();
#endif

Wire the host into your MainActivity:

private Rt150ScannerHost _scannerHost;

protected override void OnCreate(Bundle savedInstanceState)
{
    base.OnCreate(savedInstanceState);
    _scannerHost = new Rt150ScannerHost(this);
    _scannerHost.BarcodeScanned += barcode =>
    {
        var scannerService = /* resolve IHardwareScannerService */;
        scannerService?.OnScan(barcode);
    };
}

protected override void OnStart() { base.OnStart(); _scannerHost.Start(); }
protected override void OnResume() { base.OnResume(); _scannerHost.Start(); }
protected override void OnPause() { UnhookIfNeeded(); _scannerHost.Stop(); base.OnPause(); }
protected override void OnDestroy() { _scannerHost.Dispose(); base.OnDestroy(); }

Then consume scans anywhere via IHardwareScannerService.HardwareBarcodeScanned.

The RT150's native libraries (libdevapi.so, libirdaSerialPort.so, armeabi-v7a) and scan.jar ship via the CheapBarcodes.Binding dependency — no manual jniLibs setup needed.

See the CheapBarcodes demo app for a working MAUI Blazor frontend.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible.  net11.0-android37.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 0 7/16/2026
1.1.0 78 7/13/2026
1.0.1 84 7/13/2026
1.0.0 78 7/12/2026