Installing multiple apps using the Barcode Scanner using EMDK

S Sooraj PR 3 years 4 months ago
59 2 0

I am using EMDK Library in our different applications, All the applications are using the 2D Barcode Scanner. I am facing one issue when I use the scanner in multiple applications.
Suppose If I install two application in my device.
If I open the app and then open the scanner then exit the app by clicking back button after that If I open the other app it is working fine.
But,
If I open one app and then I kill the app from task manager / task list. Then here onwards, none of my app will work. In order to make it work I need to restart my device. I have also noticed that, In this case
_scanner.Status += Scanner_StatusCallBack;
if (state == StatusData.ScannerStates.Waiting)
{
Console.WriteLine(@"InitScanner :: Status -> {0}", StatusData.ScannerStates.Waiting);
}
The waiting keep on firing. No other status are firing.
In this link it has, mentioned that,
http://techdocs.zebra.com/emdk-for-android/4-2/guide/programming_practi…
The EMDKManager instance will always provide only one object (singleton object) of each feature like BarcodeManager, ProfileManager etc. Any attempt to request a new object of the same feature will return the object that is already initiated.
It is highly recommended to release one instance of the EMDKManager before creating another instance.
As per point two, it is asking to release the EMDKManager Instance. How I can release the EMDKManager Instance, If the app is killed by the user. Because I am facing the issue when the app is killed by user.
Please help.
Attaching the code I am using for your reference.

Please Register or Login to post a reply

2 Replies

D Darryn Campbell

Hi, I suggest you take a look at a recent post I did about recommendations for developing for Zebra Android devices, https://developer.zebra.com/blog/recommendations-developing-zebra-andro…, particularly the first of the 'Common questions' about half way down the page.  The recommendation is to disable the scanner in onPause() and I think that would work for you also since the application would receive an onPause() before the end user is able to switch to the task killer app.  Presumably you want the task killer app available to your end users?  If not then there are a number of solutions to prevent unwanted apps from being installed and / or run.

s subway surfers

very useful info, thank for sahring with us! https://1v1-lol.com

CONTACT
Can’t find what you’re looking for?