Scanner read not happening while returning From Activity

Hi,

 

Scanning does not happen while returning from scan activity.

Please help us to fix this issue.

 

Below is log:-

 

+ ex {Symbol.XamarinEMDK.Barcode.ScannerException: Failure

  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/4468/f913a78a/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143

  at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00083] in /Users/builder/data/lanes/4468/b16fb820/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:11624

  at Android.Runtime.JNIEnv.CallVoidMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x00000] in /Users/builder/data/lanes/4468/b16fb820/source/monodroid/src/Mono.Android/JNIEnv.g.cs:258

  at Symbol.XamarinEMDK.Barcode.Scanner.Read () [0x00043] in <9f449460540b4706a0c68b5202c50f00>:0

  at MobiClient.EMDKBaseActivity.eanScanBt_Clicked () [0x00054] in D:\Projects\git_project\lagardere\MobiClient\EMDKBaseActivity.cs:324

  --- End of managed Symbol.XamarinEMDK.Barcode.ScannerException stack trace ---

com.symbol.emdk.barcode.ScannerException: Failure

at com.symbol.emdk.barcode.Scanner.read(Scanner.java:535)
at mono.android.view.View_OnClickListenerImplementor.n_onClick(Native Method)
at mono.android.view.View_OnClickListenerImplementor.onClick(View_OnClickListenerImplementor.java:30)
at android.view.View.performClick(View.java:5205)
at android.view.View$PerformClick.run(View.java:21164)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
} Symbol.XamarinEMDK.Barcode.ScannerException

CHARITHA MALLAW...
Hi Ramesh,There might be a

Hi Ramesh,

There might be a misbehavior with your usage of OnResume/ OnPause of both activities. Please add some log messages and see where it is getting the issue. If you still have issues, attach the full ADB log to see if there is any issue with the order of API calls.

Thanks,

Charith.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ramesh dha
Hi Charitha,we have put EMDK

Hi Charitha,

we have put EMDK scanning code on single activity. All the fragments will now use scanning on its activity.

So, Right now we are not facing any issue. Problem fixed!

But we have few queries,

1. How to stop scanning after it started, when we navigate between fragments?

2. On Fragment, can we use Onresume, onpause to stop or init scanner ?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


CHARITHA MALLAW...
Good that you could identify

Good that you could identify and fixed it.

Yes, you can. But you need to release resources and acquire with some synchronization to avoid any concurrent usage of the same. Note that we recommend one instance of EMDKManager in one application.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments