Cross Platform Development
You can use any cross platform development tool if it supports using 3rd party's native libraries.
Xamarin
Xamarin is a one of cross platform development tool which supports native libraries via bindings. The outline is as follows. See Xamarin's documents for more details.
Bind the SDK for iOS
- Create a Xamarin.iOS binding library project
- Add
BRPtouchPrinterKit.framework
as a Native Reference to embed it - Bind to
BRPtourhPrinterKit.framework
writing the API definition fileApiDefinition.cs
and the types fileStructsAndEnums.cs
which can be generated using Objective Sharpie, Xamarin's command line tool - Create a Xamarin.iOS application project
- Add the binding library project as a Reference
- Write any code using SDK through the binded API in
ApiDefinition.cs
andStructsAndEnums.cs
Bind the SDK for Android
- Create a Xamarin.Android binding library project
- Add
BrotherPrintLibrary.aar
toJars
folder of the project - Customize the binding writing
Transforms/Metadata.xml
to avoid some naming conflict - Create a Xamarin.Android application project
- Add the binding library project as a Reference
- Write any code using the SDK through the API under the namespace
Com.Brother.Ptouch.Sdk
Transforms/Metadata.xml
example:
<?xml version="1.0" encoding="UTF-8"?> <metadata> <attr path="/api/package[@name='com.brother.ptouch.sdk']/class[@name='PrinterInfo']/field[@name='align']" name="managedName">EsAlign</attr> <attr path="/api/package[@name='com.brother.ptouch.sdk']/class[@name='PrinterInfo']/field[@name='checkPrintEnd']" name="managedName">EsCheckPrintEnd</attr> <attr path="/api/package[@name='com.brother.ptouch.sdk']/class[@name='PrinterInfo']/field[@name='halftone']" name="managedName">EsHalftone</attr> <attr path="/api/package[@name='com.brother.ptouch.sdk']/class[@name='PrinterInfo']/field[@name='margin']" name="managedName">EsMargin</attr> <attr path="/api/package[@name='com.brother.ptouch.sdk']/class[@name='PrinterInfo']/field[@name='orientation']" name="managedName">EsOrientation</attr> <attr path="/api/package[@name='com.brother.ptouch.sdk']/class[@name='PrinterInfo']/field[@name='paperSize']" name="managedName">EsPaperSize</attr> <attr path="/api/package[@name='com.brother.ptouch.sdk']/class[@name='PrinterInfo']/field[@name='pjFeedMode']" name="managedName">EsPjFeedMode</attr> <attr path="/api/package[@name='com.brother.ptouch.sdk']/class[@name='PrinterInfo']/field[@name='port']" name="managedName">EsPort</attr> <attr path="/api/package[@name='com.brother.ptouch.sdk']/class[@name='PrinterInfo']/field[@name='printMode']" name="managedName">EsPrintMode</attr> <attr path="/api/package[@name='com.brother.ptouch.sdk']/class[@name='PrinterInfo']/field[@name='printQuality']" name="managedName">EsPrintQuality</attr> <attr path="/api/package[@name='com.brother.ptouch.sdk']/class[@name='PrinterInfo']/field[@name='pjPaperKind']" name="managedName">EsPjPaperKind</attr> </metadata>