ZXing.Net.Mobile
1.4.5-beta
See the version list below for details.
dotnet add package ZXing.Net.Mobile --version 1.4.5-beta
NuGet\Install-Package ZXing.Net.Mobile -Version 1.4.5-beta
<PackageReference Include="ZXing.Net.Mobile" Version="1.4.5-beta" />
paket add ZXing.Net.Mobile --version 1.4.5-beta
#r "nuget: ZXing.Net.Mobile, 1.4.5-beta"
// Install ZXing.Net.Mobile as a Cake Addin
#addin nuget:?package=ZXing.Net.Mobile&version=1.4.5-beta&prerelease
// Install ZXing.Net.Mobile as a Cake Tool
#tool nuget:?package=ZXing.Net.Mobile&version=1.4.5-beta&prerelease
ZXing.Net.Mobile is a C#/.NET library based on the open source Barcode Library: ZXing (Zebra Crossing), using the ZXing.Net Port. It works with Xamarin.iOS, Xamarin.Android, and Windows Phone. The goal of ZXing.Net.Mobile is to make scanning barcodes as effortless and painless as possible in your own applications!
GitHub Project: https://github.com/Redth/ZXing.Net.Mobile
### Usage
```csharp
buttonScan.Click += (sender, e) => {
//NOTE: On Android, you MUST pass a Context into the Constructor!
var scanner = new ZXing.Mobile.MobileBarcodeScanner();
var result = await scanner.Scan();
if (result != null)
Console.WriteLine("Scanned Barcode: " + result.Text);
};
```
###Features
- Xamarin.iOS
- Xamarin.Android
- Windows Phone
- Simple API - Scan in as little as 2 lines of code!
- Scanner as a View - UIView (iOS) / Fragment (Android) / Control (WP)
###Custom Overlays
By default, ZXing.Net.Mobile provides a very simple overlay for your barcode scanning interface. This overlay consists of a horizontal red line centered in the scanning 'window' and semi-transparent borders on the top and bottom of the non-scanning area. You also have the opportunity to customize the top and bottom text that appears in this overlay.
If you want to customize the overlay, you must create your own View for each platform. You can customize your overlay like this:
```csharp
var scanner = new ZXing.Mobile.MobileBarcodeScanner();
scanner.UseCustomOverlay = true;
scanner.CustomOverlay = myCustomOverlayInstance;
var result = await scanner.Scan();
//Handle result
```
Keep in mind that when using a Custom Overlay, you are responsible for the entire overlay (you cannot mix and match custom elements with the default overlay). The *ZxingScanner* instance has a *CustomOverlay* property, however on each platform this property is of a different type:
- Xamarin.iOS => **UIView**
- Xamarin.Android => **View**
- Windows Phone => **UIElement**
All of the platform samples have examples of custom overlays.
###Barcode Formats
By default, all barcode formats are monitored while scanning. You can change which formats to check for by passing a ZxingScanningOptions instance into the StartScanning method:
```csharp
var options = new ZXing.Mobile.MobileBarcodeScanningOptions();
options.PossibleFormats = new List<ZXing.BarcodeFormat>() {
ZXing.BarcodeFormat.Ean8, ZXing.BarcodeFormat.Ean13
};
var scanner = new ZXing.Mobile.MobileBarcodeScanner();
var result = await scanner.Scan(options);
//Handle result
```
###Using the ZXingScanner View / Fragment / Control
On each platform, the ZXing scanner has been implemented as a reusable component (view, fragment, or control), and it is possible to use the reusable component directly without using the MobileBarcodeScanner class at all. On each platform, the instance of the view/fragment/control contains the necessary properties and methods required to control your scanner. By default, the default overlay is automatically used, unless you set the CustomOverlay property as well as the UseCustomOverlay property on the instance of the view/fragment/control. You can use methods such as ToggleTorch() or StopScanning() on the view/fragment/control, however you are responsible for calling StartScanning(...) with a callback and an instance of MobileBarcodeScanningOptions when you are ready for the view's scanning to begin. You are also responsible for stopping scanning if you want to cancel at any point.
The view/fragment/control classes for each platform are:
- iOS: ZXingScannerView (UIView) - See ZXingScannerViewController.cs View Controller for an example of how to use this view
- Android: ZXingScannerFragment (Fragment) - See ZXingActivity.cs Activity for an example of how to use this fragment
- Windows Phone: ZXingScannerControl (UserControl) - See ScanPage.xaml Page for an example of how to use this Control
###Using Apple's AVCaptureS
Product | Versions Compatible and additional computed target framework versions. |
---|---|
MonoAndroid | monoandroid10 is compatible. |
MonoTouch | monotouch10 is compatible. |
Windows Phone | wp8 is compatible. wp81 was computed. |
This package has no dependencies.
NuGet packages (24)
Showing the top 5 NuGet packages that depend on ZXing.Net.Mobile:
Package | Downloads |
---|---|
ZXing.Net.Mobile.Forms
ZXing.Net.Mobile is a C#/.NET library based on the open source Barcode Library: ZXing (Zebra Crossing), using the ZXing.Net Port. It works with Xamarin.iOS, Xamarin.Android, Tizen and Windows Universal (UWP). The goal of ZXing.Net.Mobile is to make scanning barcodes as effortless and painless as possible in your own applications. See https://github.com/Redth/ZXing.Net.Mobile/releases for release notes. |
|
SheshaMobile.Modules.Events
The events module contains common functionality and essetntials required to build apps that have event specific functionality |
|
SheshaMobile.Core.Android
Common application functionality and features to be shared across the framework for Android |
|
SheshaMobile.Core.iOS
Common application functionality and features to be shared across the framework for iOS |
|
ItEnterprise.Common.CoreStandard
ItEnterprise Common.CoreStandard for Xamarin Forms |
GitHub repositories (10)
Showing the top 5 popular GitHub repositories that depend on ZXing.Net.Mobile:
Repository | Stars |
---|---|
bitwarden/mobile
The mobile app vault (iOS and Android).
|
|
Baseflow/LottieXamarin
Render After Effects animations natively on Android, iOS, MacOS and TvOS for Xamarin
|
|
xamarinhq/app-conference
Pre-build conference application built with Xamarin
|
|
kwsch/PKHeX.Mobile
Pokémon save editor for Android and iOS!
|
|
oybab/TradingSystem
A multi-language cross-platform open source free software: Oybab Trading System.
|
Version | Downloads | Last updated |
---|---|---|
3.1.0-beta2 | 738,193 | 1/19/2021 |
3.0.0-beta5 | 340,603 | 3/14/2020 |
3.0.0-beta4 | 6,167 | 3/12/2020 |
3.0.0-beta3 | 2,572 | 3/12/2020 |
3.0.0-beta2 | 2,530 | 3/12/2020 |
3.0.0-beta1 | 22,557 | 3/12/2020 |
2.4.1 | 5,169,089 | 4/4/2018 |
2.4.0-beta1 | 4,347 | 3/14/2018 |
2.3.2 | 335,710 | 10/25/2017 |
2.3.1 | 35,866 | 10/25/2017 |
2.2.9 | 220,145 | 4/14/2017 |
2.2.8 | 5,609 | 4/14/2017 |
2.2.6 | 4,144 | 4/14/2017 |
2.2.5 | 3,703 | 4/14/2017 |
2.2.0 | 6,350 | 4/12/2017 |
2.1.47 | 343,555 | 8/24/2016 |
2.1.46 | 4,609 | 8/24/2016 |
2.1.45 | 9,141 | 8/23/2016 |
2.1.44 | 5,809 | 8/17/2016 |
2.1.43 | 3,476 | 8/17/2016 |
2.1.13 | 16,264 | 7/19/2016 |
2.1.12 | 34,837 | 7/19/2016 |
2.1.10-beta | 2,831 | 7/19/2016 |
2.1.0-beta1 | 11,620 | 4/18/2016 |
2.0.4.46 | 49,252 | 2/9/2016 |
2.0.4.24 | 88,508 | 1/18/2016 |
2.0.4.23 | 3,787 | 1/18/2016 |
2.0.4.19 | 4,001 | 1/13/2016 |
2.0.4.18 | 3,669 | 1/13/2016 |
2.0.4.17 | 18,124 | 1/13/2016 |
2.0.3.1 | 6,689 | 12/18/2015 |
2.0.3 | 3,485 | 12/18/2015 |
2.0.2 | 3,394 | 12/18/2015 |
2.0.1 | 10,930 | 12/15/2015 |
2.0.0 | 4,663 | 12/15/2015 |
1.5.4 | 15,869 | 11/12/2015 |
1.5.3 | 3,303 | 11/10/2015 |
1.5.2 | 2,727 | 11/10/2015 |
1.5.1 | 13,869 | 7/31/2015 |
1.5.0 | 3,712 | 7/30/2015 |
1.4.7.1 | 19,707 | 1/12/2015 |
1.4.7 | 4,446 | 12/9/2014 |
1.4.6 | 7,355 | 8/5/2014 |
1.4.5 | 3,259 | 7/3/2014 |
1.4.5-beta | 3,018 | 4/14/2014 |
1.4.2.1 | 3,967 | 1/29/2014 |
1.4.2 | 7,840 | 1/29/2014 |