title: Xamarin Android, Java Bindings Library and IJavaPeerable Implementation
body: <p>I have created a Bindings Library as detailed here <a href="https://docs.microsoft.com/en-us/samples/xamarin/monodroid-samples/javaintegration-aarbinding/" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/samples/xamarin/monodroid-samples/javaintegration-aarbinding/</a> for a .aar file.</p>
  <p>This exposes a method</p>
  <pre><code>GetBarCode (global::Com.Scandecode.Inf.IScanInterfaceOnScanListener scanListener)
  </code></pre>
  <p>IScanInterfaceOnScanListener inherits IJavaObject, IJavaPeerable.</p>
  <p>How do I implement the inherited methods from IJavaPeerable so I can call this method?</p>
  <pre><code>void SetJniIdentityHashCode(int value)
  void SetPeerReference(JniObjectReference reference)
  void SetJniManagedPeerState(JniManagedPeerStates value
  void UnregisterFromRuntime()
  void DisposeUnlessReferenced()
  void Disposed()
  void Finalized()
  </code></pre>
  <p>OR
  Is there a problem with my bindings library? This is the example Java code given:</p>
  <pre><code>       scanDecode.getBarCode(new ScanInterface.OnScanListener() {
              @Override
              public void getBarcode(String data) {
                  scancount+=1;
                  tvcound.setText(getString(R.string.scan_time)+scancount+&quot;&quot;);
                  mReception.append(data+&quot;\n&quot;);
              }
  
              @Override
              public void getBarcodeByte(byte[] bytes) {
                  //返回原始解码数据
  //                scancount+=1;
  //                tvcound.setText(getString(R.string.scan_time)+scancount+&quot;&quot;);
  //                mReception.append(DataConversionUtils.byteArrayToString(bytes) +&quot;\n&quot;);
              }
          });
  </code></pre>
  <p>ScanInterface.OnScanListener does not appear to be generated by the Bindings library.</p>
  <p>Background: This is for integration with a hardware barcode scanner on a Newland SD100 tablet.</p>
  <p>Edit:
  Seems similar to implementing IEventListener, will do some more research</p>