Closed DCox2016 closed 8 months ago
Hi @DCox2016. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Hello @DCox2016 shouldn't this be logged on the developer.zebra.com ?
I'll need to consult with my supervisor regarding the allocation of time for creating a minimal reproducible example. With respect to logging this issue on developer.zebra.com, I believe it's not necessary. The EMDK library from Zebra is performing as anticipated; it successfully scans and returns the correct barcode number. The root of the challenge appears to be the dependency mechanism within Maui and Xamarin. Our observations indicate that rapid scanning exacerbates the lag between the platform-specific code and the Maui or Xamarin layers. However, in our tests using a Xamarin Android-only app that exclusively utilized Android-native code, we observed no such bottleneck or duplicate entries.
@DCox2016 I think we need more info to be able to take action on this. I'm not familiar with the Zebra library. Where is the data being received incorrectly? Do you have a sense of where the problem might be?
Hi @DCox2016. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
@DCox2016 Zebra emdk is deprecated to read barcodes. You should use datawedge and intents.
Hi @DCox2016. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
@Eilon the issue is not scanning the data it's that Maui is posting the data multiply times to the database. The scanner only returns the barcode or sku once. I have added advance logs to capture this. I added a count on the post to see how many time the post happens on the Maui side and the count happens more than once, so the data is being posted over and over again in a matter of seconds.
@acaliaro actual I did try the data wedge approach with weak reference manager and the same thing happened. What actual worked for me was invoking platform side code. I did a test with Android Xamarin project and the duplicates did not happen. https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/invoke-platform-code also the EMDK is not deprecated Zebra does have documentation on how to add it https://developer.zebra.com/blog/developing-net-maui-zebra-androidtm-devices . I know #if Android in the code is not pretty but this helps without using an interface which I believe had something that might have been a part of the issue.
@Eilon the issue is not scanning the data it's that Maui is posting the data multiply times to the database. The scanner only returns the barcode or sku once. I have added advance logs to capture this. I added a count on the post to see how many time the post happens on the Maui side and the count happens more than once, so the data is being posted over and over again in a matter of seconds.
MAUI doesn't post data to any database, so there must be some other code in there that's running. Are you able to set a breakpoint in the database update code and see why it's getting called twice? Make sure you disable "Just My Code" so that the entire stack trace can be seen.
@acaliaro actual I did try the data wedge approach with weak reference manager and the same thing happened. What actual worked for me was invoking platform side code. I did a test with Android Xamarin project and the duplicates did not happen. https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/invoke-platform-code also the EMDK is not deprecated Zebra does have documentation on how to add it https://developer.zebra.com/blog/developing-net-maui-zebra-androidtm-devices . I know #if Android in the code is not pretty but this helps without using an interface which I believe had something that might have been a part of the issue.
you have not to use emdk to read a barcode. Have you tried my sample on github? Do you have the same problem with it?
Yes, it is not the data wedge or the emdk that the issue it is Maui sending multiple post. The data comes from the Android platform once but it post multiply times on the Maui side of code. What resolved the issue was invoking platform side code. No, I did not use your solution we have a data wedge solution with event handlers and multiple post still happen. The issue only reproduceable on a Zebra T51 and T52. Due to emulators not having the emdk you can not use an emulator.
@DCox2016 do you have more details about "it is Maui sending multiple post"? .NET MAUI doesn't send or post anything to anywhere, so I'm not sure what could be doing that. Do you have a call stack that shows what is doing the "multiple post" each time?
From what I read here this seems like this should be fixed in the business logic and not something that originates from within .NET MAUI.
There has not been a response for a good while now and there have been repeated asks for relevant code or a reproduction sample which can't be provided. Without it, it will be impossible to determine if there is action for us to take here. As such, I'm closing this on our end.
Thanks for the input here everyone!
Description
Environment: Platform: Android .NET MAUI Version: 7.0.86/7.0.100 Zebra EMDK Library Version: 8.0.0.9
When rapidly performing multiple scans using the Zebra EMDK library within a .NET MAUI project, we're experiencing an issue where scans are being submitted multiple times in a row with identical SKU numbers and timestamps. As a result, we observe duplicates, triplicates, and sometimes even quadruplicates of the same scan entry.
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
7.0.92
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 10
Did you find any workaround?
yes, we tired to use a data wedge, interface, and event handler but the same thing. To prevent the issue we had to do platform check on the maui side of code and execute the Android side code this skipped the abstracted dependency mechanism and the duplicates stopped. i.e
@if __Android ___ //instance of android class AndroidClass ac = new AndroidClass(); var somefunction = ac.TestFunction() @endIf
Relevant log output
No response