itos.scan
2.0.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package itos.scan --version 2.0.2
NuGet\Install-Package itos.scan -Version 2.0.2
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="itos.scan" Version="2.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add itos.scan --version 2.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: itos.scan, 2.0.2"
#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.
// Install itos.scan as a Cake Addin
#addin nuget:?package=itos.scan&version=2.0.2
// Install itos.scan as a Cake Tool
#tool nuget:?package=itos.scan&version=2.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ITOS IOT Barcode scanning SDK.
Note: The SDK requires WRITE_SETTINGS permission
APIS:
Scanner.cs
namespace Com.Olc.Scan
{
public interface Scanner
{
//Barcode prefix
string GetBarcodePrefix();
void SetBarcodePrefix(string p1);
//Is barcode prefix enabled
bool GetBarcodePrefixState();
void SetBarcodePrefixState(bool p1);
//Barcode receiving mode, 0 : fast; 1 : slow; 2 : broadcast
int GetBarcodeReceiveModel();
void SetBarcodeReceiveModel(int p1);
//Barcode separator 0:no separator, 1:\r, 2:\n, 3:Tab
int GetBarcodeSeparator();
void SetBarcodeSeparator(int p1);
//Barcode suffix
string GetBarcodeSuffix();
void SetBarcodeSuffix(string p1);
//Is barcode suffix enabled
bool GetBarcodeSuffixState();
void SetBarcodeSuffixState(bool p1);
//Custom continuous scan interval time In seconds
float GetScanDelay();
void SetScanDelay(float p1);
//Continuous scanning interval time, 0: no interval time, 1: 0.5s interval time, 2: 1s interval time, 3: Customize the scanning interval time and set the value using SetScanDelay
int GetScanDelaySetting();
void SetScanDelaySetting(int p1);
//Scan mode, 0: Normal scanning, 1: automatic continuous scanning, 2: manual continuous scanning
int GetScanModel();
void SetScanModel(int p1);
//Is scanning sound enabled
bool GetScanSound();
void SetScanSound(bool p1);
//Is scanning left click enabled
bool GetScanSwitchLeft();
void SetScanSwitchLeft(bool p1);
//Is scanning right click enabled
bool GetScanSwitchRight();
void SetScanSwitchRight(bool p1);
//Is scanning vibrate enabled
void SetScanVibrate(bool p1);
bool GetScanVibrate();
}
}
example:
using Android.App;
using Android.OS;
using Android.Runtime;
using AndroidX.AppCompat.App;
using Android.Widget;
using Com.Olc.Scan;
using Android.Content;
namespace xa_scan
{
[Activity(Label = "@string/app_name", Theme = "@style/AppTheme", MainLauncher = true)]
public class MainActivity : AppCompatActivity
{
private TextView codes;
private Scanner scanner;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
SetContentView(Resource.Layout.activity_main);
codes = FindViewById<TextView>(Resource.Id.codes);
RegisterReceiver(new MainReceiver(this), new IntentFilter("com.barcode.sendBroadcast"));
}
protected override void OnStart()
{
base.OnStart();
scanner = ScannerFactory.factory(this, (Scanner scan) =>
{
scan.SetScanSwitchLeft(true);
scan.SetBarcodeReceiveModel(2);
scan.SetScanModel(0);
applendText("left key:" + scan.GetScanSwitchLeft());
applendText("right key:" + scan.GetScanSwitchRight());
applendText("scan model:" + scan.GetScanModel());
});
}
public void applendText(string txt)
{
codes.Text = codes.Text + txt + "\n";
}
public class MainReceiver : BroadcastReceiver
{
MainActivity mainactivity;
public MainReceiver(MainActivity main)
{
this.mainactivity = main;
}
public override void OnReceive(Context context, Intent intent)
{
string code = intent.GetStringExtra("BARCODE");
if (!code.Equals(""))
{
mainactivity.applendText("Code:" + code);
}
}
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0-android was computed. net7.0-android was computed. net8.0-android was computed. |
MonoAndroid | monoandroid is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
support android 11