com.brother.bms.androidBindingLibrary
1.2.4091
dotnet add package com.brother.bms.androidBindingLibrary --version 1.2.4091
NuGet\Install-Package com.brother.bms.androidBindingLibrary -Version 1.2.4091
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="com.brother.bms.androidBindingLibrary" Version="1.2.4091" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="com.brother.bms.androidBindingLibrary" Version="1.2.4091" />
<PackageReference Include="com.brother.bms.androidBindingLibrary" />
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 com.brother.bms.androidBindingLibrary --version 1.2.4091
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: com.brother.bms.androidBindingLibrary, 1.2.4091"
#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.
#addin nuget:?package=com.brother.bms.androidBindingLibrary&version=1.2.4091
#tool nuget:?package=com.brother.bms.androidBindingLibrary&version=1.2.4091
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Readme
What is this library?
This is a library that takes the Brother SDK for Android and binds it in a library that users of .NET MAUI can consume
Requirements
Adjust the Import location
When you download the nuget package, the package will be imported to both iOS and Android.
<Project Sdk="Microsoft.NET.Sdk">
...
...
<PackageReference Include="com.brother.bms.androidBindingLibrary" Version="1.0.4091" />
...
...
</Project>
Move this PackageReference into a target specific tag.
<Project Sdk="Microsoft.NET.Sdk">
...
...
<ItemGroup Condition="'$(TargetFramework)'=='net8.0-android'">
<PackageReference Include="com.brother.bms.androidBindingLibrary" Version="1.0.4091" />
</ItemGroup>
...
...
</Project>
Set Workpath
You MUST set workpath before printing.
public static string? PrivateStorage(string location)
{
AndroidOS.Content.Context context = AndroidOS.App.Application.Context;
Java.IO.File? filesDir = context.GetExternalFilesDir(location);
return filesDir?.ToString();
}
//Example
RJPrintSettings rjPrintSettings = new(PrinterModel.Rj4250wb)
{
HalftoneThreshold = 128,
Rotate180degrees = false,
WorkPath = PrivateStorage(CommonStrings.WORKPATH),
};
How to use this library
In your android code, import the library com.brother.sdk.lmprinter
RJPrintSettings rjPrintSettings = new(PrinterModel.Rj4250wb)
{
HalftoneThreshold = 128,
Rotate180degrees = false,
WorkPath = PrivateStorage(CommonStrings.WORKPATH), //See Requirements below for details and method body
};
Android.Bluetooth.BluetoothAdapter? btAdapter = Bluetooth.BTAdapter();
Channel printerChannel = Channel.NewBluetoothChannel("macAddressOfPrinter",btAdapter);
var printResult = ImagePrinting(channel,"locationOfThingToPrint",rjPrintSettings);
private static string ImagePrinting(Channel? printerChannel, string ThingToPrint, IPrintSettings printSettings)
{
PrinterDriverGenerateResult? PrinterDriverGenerateResult = PrinterDriverGenerator.OpenChannel(printerChannel);
OpenChannelError? printerDriverError = PrinterDriverGenerateResult?.Error;
OpenChannelError.ErrorCode? driverErrorCode = printerDriverError?.Code;
Debug.WriteLine("Driver Error: " + driverErrorCode?.ToString() ?? "Driver Error is null");
// There was no error
if (driverErrorCode is not null && driverErrorCode.Equals(OpenChannelError.ErrorCode.NoError))
{
if (PrinterDriverGenerateResult is not null)
{
PrinterDriver? _PrinterDriver = PrinterDriverGenerateResult.Driver;
// TODO: This is only going to work if the file is in local storage.
string imagePath = Path.Combine(FileSystem.Current.AppDataDirectory, ThingToPrint);
if (_PrinterDriver is not null)
{
PrintError? PrintResult = _PrinterDriver.PrintImage(imagePath, printSettings);
_PrinterDriver.CloseChannel();
if (PrintResult is not null)
{
// If there's an error with printing
if (!PrintResult.ToString().Equals(PrintError.ErrorCode.NoError))
return string.Concat("Print Error PDF Print: ", PrintResult.ToString());
else return PrintResult.ToString();
}
else return "Error in PrintImage";
}
else return "Printer Driver error";
}
else return "Open Channel Failed";
}
else return driverErrorCode?.ToString() ?? "Printer Driver Error";
}
Resources
Brother Print SDK Manual
https://support.brother.com/g/s/es/htmldoc/mobilesdk/index.html
BMS Website
https://brothermobilesolutions.com/
Contact Information
E-mail us: bmsdevsupport@brother.com
SDK Version
This library binding is completed against SDK version 4.9.1
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-android34.0 is compatible. net9.0-android was computed. net9.0-android35.0 is compatible. net10.0-android was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0-android34.0
- Xamarin.AndroidX.Legacy.Support.Core.Utils (>= 1.0.0.26)
-
net9.0-android35.0
- Xamarin.AndroidX.Legacy.Support.Core.Utils (>= 1.0.0.26)
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.2.4091 | 0 | 6/4/2025 |
1.0.4091 | 1 | 6/4/2025 |
1.0.1002-alpha | 1 | 6/4/2025 |
releaseNotes.md