Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have created a Bindings Library as detailed here https://docs.microsoft.com/en-us/samples/xamarin/monodroid-samples/javaintegration-aarbinding/ for a .aar file.

This exposes a method

GetBarCode (global::Com.Scandecode.Inf.IScanInterfaceOnScanListener scanListener)

IScanInterfaceOnScanListener inherits IJavaObject, IJavaPeerable.

How do I implement the inherited methods from IJavaPeerable so I can call this method?

void SetJniIdentityHashCode(int value)
void SetPeerReference(JniObjectReference reference)
void SetJniManagedPeerState(JniManagedPeerStates value
void UnregisterFromRuntime()
void DisposeUnlessReferenced()
void Disposed()
void Finalized()

OR Is there a problem with my bindings library? This is the example Java code given:

       scanDecode.getBarCode(new ScanInterface.OnScanListener() {
            @Override
            public void getBarcode(String data) {
                scancount+=1;
                tvcound.setText(getString(R.string.scan_time)+scancount+"");
                mReception.append(data+"
");
            }

            @Override
            public void getBarcodeByte(byte[] bytes) {
                //返回原始解码数据
//                scancount+=1;
//                tvcound.setText(getString(R.string.scan_time)+scancount+"");
//                mReception.append(DataConversionUtils.byteArrayToString(bytes) +"
");
            }
        });

ScanInterface.OnScanListener does not appear to be generated by the Bindings library.

Background: This is for integration with a hardware barcode scanner on a Newland SD100 tablet.

Edit: Seems similar to implementing IEventListener, will do some more research

question from:https://stackoverflow.com/questions/65887864/xamarin-android-java-bindings-library-and-ijavapeerable-implementation

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
712 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...