BarcodeScanning.Native.Maui
0.9.1
See the version list below for details.
dotnet add package BarcodeScanning.Native.Maui --version 0.9.1
NuGet\Install-Package BarcodeScanning.Native.Maui -Version 0.9.1
<PackageReference Include="BarcodeScanning.Native.Maui" Version="0.9.1" />
paket add BarcodeScanning.Native.Maui --version 0.9.1
#r "nuget: BarcodeScanning.Native.Maui, 0.9.1"
// Install BarcodeScanning.Native.Maui as a Cake Addin #addin nuget:?package=BarcodeScanning.Native.Maui&version=0.9.1 // Install BarcodeScanning.Native.Maui as a Cake Tool #tool nuget:?package=BarcodeScanning.Native.Maui&version=0.9.1
BarcodeScanning.Native.Maui
Barcode scanning library based on native platform APIs for barcode detection:
This library was inspired by existing MAUI barcode scanning libraries: BarcodeScanner.Mobile & Zxing.Net.MAUI, but comes with many code improvements and uses native ML APIs on both Android and iOS.
Key features
- Uses native APIs for maximal performance and barcode readability,
- Optimized for continuous scanning,
- Ability to scan multiple barcodes in one frame,
- Ability to pool multiple scans for better scanning consistency,
- Transformed barcode bounding box for on-screen positioning,
- Code-behind and MVVM compatibility,
- Android ony - Abillity to invert source image to scan natively unsupported inverted barcodes, but at a performance cost.
Usage
Install Nuget package,
Initialize the plugin in your
MauiProgram.cs
:public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder ... .UseBarcodeScanning(); ... return builder.Build(); }
Add required permissions:
Android
Edit
AndroidManifest.xml
file (under the Platforms\Android folder) and add the following permissions inside of themanifest
node:<uses-permission android:name="android.permission.CAMERA" />
iOS
Edit
info.plist
file (under the Platforms\iOS folder) and add the following permissions inside of thedict
node:<key>NSCameraUsageDescription</key> <string>Enable camera for barcode scanning.</string>
In XAML, add correct namespace:
xmlns:scanner="clr-namespace:BarcodeScanning;assembly=BarcodeScanning.Native.Maui"
Listen to
OnDetectionFinished
event in Code-behind or bindOnDetectionFinishedCommand
property to a Command in your ViewModel.
An example can be found in BarcodeScanning.Test project.
Supported barcode symbologies
Android
1D: Codabar, Code 39, Code 93, Code 128, EAN-8, EAN-13, ITF, UPC-A, UPC-E; 2D: Aztec, Data Matrix, PDF417, QR Code
iOS
1D: Codabar, Code 39, Code 93, Code 128, EAN-8, EAN-13, GS1 DataBar, ITF, UPC-E; 2D: Aztec, Data Matrix, MicroPDF417, MicroQR, PDF417, QR Code
Bindable properties
A list of bindable properties with descriptions can be found in ICameraView.cs interface source file.
TODO Windows and macOS support
Windows and macOS are currently unsupported, but support can be added in the future. Vision framework is compatible with macOS so this implementation wouldn't be difficult. For Windows, barcode detection could be supported through Zxing.Net project.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0-android31.0 is compatible. net6.0-ios16.1 is compatible. net7.0-android was computed. net7.0-ios was computed. net8.0-android was computed. net8.0-ios was computed. |
-
net6.0-android31.0
- Xamarin.AndroidX.Camera.Camera2 (>= 1.2.0)
- Xamarin.AndroidX.Camera.View (>= 1.2.0)
- Xamarin.Google.MLKit.BarcodeScanning (>= 117.0.3.1)
-
net6.0-ios16.1
NuGet packages (1)
Showing the top 1 NuGet packages that depend on BarcodeScanning.Native.Maui:
Package | Downloads |
---|---|
OpenMAUIAndroid
Uma lib de leitura de código de barras que agrupa os mais diversos SDKs e EMDKs de fabricantes de coletores de dados, e gerencia tudo de forma automática. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.1.1 | 85 | 11/25/2024 |
2.0.1 | 321 | 11/19/2024 |
2.0.0 | 236 | 11/18/2024 |
1.7.1 | 66 | 11/25/2024 |
1.6.0 | 1,237 | 11/11/2024 |
1.5.9 | 3,624 | 10/19/2024 |
1.5.8 | 3,870 | 10/1/2024 |
1.5.7 | 24,996 | 7/11/2024 |
1.5.6 | 9,094 | 6/19/2024 |
1.5.5 | 1,212 | 6/12/2024 |
1.5.3 | 3,073 | 5/24/2024 |
1.5.2 | 1,379 | 5/17/2024 |
1.5.0 | 12,060 | 4/20/2024 |
1.4.3 | 1,243 | 4/11/2024 |
1.4.2 | 1,404 | 4/4/2024 |
1.4.1 | 1,701 | 3/22/2024 |
1.4.0 | 571 | 3/17/2024 |
1.3.1 | 3,009 | 3/13/2024 |
1.3.0 | 150 | 3/13/2024 |
1.2.5 | 685 | 3/8/2024 |
1.2.4 | 6,147 | 1/24/2024 |
1.2.3 | 1,302 | 1/9/2024 |
1.2.2 | 796 | 12/27/2023 |
1.2.1 | 360 | 12/20/2023 |
1.2.0 | 361 | 12/17/2023 |
1.1.1 | 350 | 12/6/2023 |
1.1.0 | 318 | 12/4/2023 |
1.0.3 | 280 | 11/27/2023 |
1.0.2 | 441 | 11/24/2023 |
1.0.1 | 292 | 11/16/2023 |
0.9.3 | 4,946 | 4/19/2023 |
0.9.1 | 259 | 3/31/2023 |