Epson ePOS SDK for Android (Xamarin) missing constants

后端 未结 2 436
暖寄归人
暖寄归人 2021-01-28 23:30

We are trying to updgrade the SDK of epson, which is deprecated since a long while.

We were using the old ePOS-Print SDK (com.epson.eposprint) package and we began havin

相关标签:
2条回答
  • 2021-01-28 23:55

    For anyone still struggling with this, I've found a solution that seems to do the job without re-writing the library.

    1. In your solution, create a new "Android Bindings Library (Xamarin)" project.
    2. Add the ePOS2.jar (and ePOSEasySelect.jar if needed) file to the "Jars" folder and set the file's build action (in the properties window) to "EmbeddedJar".
    3. INSTALL THE OPOS Common Control Objects (CCOs) locally (OPOS_CCOs_1.14.001.msi) from the Epson ePOS SDK for Android download.
    4. Copy all of the resulting .dll files to your project from step 1. I've used a "lib" folder within it, but you do you.
    5. Reference the .dlls from the project.
    6. Build.

    You should end up with a library you can reference from other projects and make use of the Com.Epson.Epos2 namespace and all the classes within it.

    For reference, most of the useful constants are accessed through the Com.Epson.Eposdevice namespace. e.g. Com.Epson.Eposdevice.Printer.Printer.LangEn

    Note: There is no default DiscoveryListener class, so you would need to build your own if you go down that route.

    Also worth remembering most Java projects use camelCaseFormatting for their method names, so when copy/pasting examples from the documentation (which is woeful), don't forget to change your methods to TitleCaseFormatting.

    Also, Also: I keep getting an error with global::Com.Epson.Epos2.Printer.LogoKeyCode not existing for whatever reason. A temporary solution is to add the following line to the MetaData.xml file in the Bindings Library's Transforms folder:

      <remove-node path="/api/package[@name='com.epson.epos2.printer']/class[@name='Printer']/method[@name='getLogoList' and count(parameter)=0]"/>
    
    0 讨论(0)
  • 2021-01-29 00:07

    EDIT : Solution is to make sure all objects with no visibility keywords in the SDK is fixed with the Metadata.xml Transforms file, this way:

    <!-- On enlève l'ancienne classe du package qui ne sert plus à rien, juste pour la migration -->
    <remove-node path="/api/package[starts-with(@name, 'com.epson.epsonio')]" />
    
    <!-- Need to change the visibility of many ommited classes visibility in jar epos -->
    <attr path="/api/package[@name='com.epson.eposdevice']/class[@name='NativeDevice']"
          name="visibility">public</attr>
    
    <attr path="/api/package[@name='com.epson.eposdevice.commbox']/class[@name='NativeCommBox']"
          name="visibility">public</attr>
    
    <attr path="/api/package[@name='com.epson.eposdevice.commbox']/class[@name='NativeCommBoxManager']"
          name="visibility">public</attr>
    
    <attr path="/api/package[@name='com.epson.eposdevice.keyboard']/class[@name='NativeKeyboard']"
          name="visibility">public</attr>
    
    <attr path="/api/package[@name='com.epson.eposdevice.printer']/class[@name='NativePrinter']"
          name="visibility">public</attr>
    
    <attr path="/api/package[@name='com.epson.eposdevice.scanner']/class[@name='NativeScanner']"
          name="visibility">public</attr>
    
    <attr path="/api/package[@name='com.epson.eposdevice.simpleserial']/class[@name='NativeSimpleSerial']"
          name="visibility">public</attr>
    
    <attr path="/api/package[@name='com.epson.eposdevice']/class[@name='DeviceInnerImplement']"
          name="visibility">protected</attr>
    
    <attr path="/api/package[@name='com.epson.eposdevice']/class[@name='NativeDevice']"
          name="visibility">public</attr>
    
    <attr path="/api/package[@name='com.epson.epos2.printer']/class[@name='CommonPrinter']"
          name="visibility">public</attr>
    
    <attr path="/api/package[@name='com.epson.epos2.printer']/class[@name='LogoKeyCode']"
          name="visibility">public</attr>
    
    <attr path="/api/package[@name='com.epson.epos2']/class[@name='NativeInitializer']"
          name="visibility">public</attr>
    
    <attr path="/api/package[@name='com.epson.epos2']/class[@name='OutputLog']"
          name="visibility">public</attr>
    
    <attr path="/api/package[@name='com.epson.eposdevice.display']/class[@name='NativeDisplay']"
          name="visibility">public</attr>
    
    <attr path="/api/package[@name='com.epson.eposdevice']/class[@name='Device.DeleteDeviceCallbackAdapter']"
          name="visibility">protected</attr>
    
    0 讨论(0)
提交回复
热议问题