javac#xamarin.androidepos

Epson ePOS SDK for Android (Xamarin) missing constants


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 having problems with it, so we rightly decided to migrate to the current one, Epson ePOS SDK for Android (com.epson.epos2).

We are using Visual Studio Xamarin.

We followed the migration document included in the SDK. Replaced most of the code. But, it seems that either Xamarin has problem the java bindings or something is missing, because almost 90% of the enum values are not available. It's almost near impossible without the enum values to correctly call the methods... For example, we do have some of the enums available (like the BatteryLevelX, TMxx, Pattern*), but that's about it.

We are using Android 8.0

Our javabinding project is configured like that:

--JarLibrary
----Jars
-------ePOS2.jar
-------ePOSEasySelect.jar
----libs
------armeabi
--------libepos2.so
--------libeposeasyselect.so
------armeabi-v7a
--------libepos2.so
--------libeposeasyselect.so

Project Properties:

Android Class parser: jar2xml Android codegen target: XAJavaInterop1

Any ideas why this is?

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>

Solution

  • 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>