Scan barcode with TC55 in more than one activity

In my app, I need to scan bar code in multiple activities. I created a profile in Data Wedge & listed my app/activities in that profile. Now, let's say I have two activities where I need to scan bar code: Activity A & Activity B. In Activity A, if I press the scan button, a dialog pops up with two options, asking me to choose from Activity A & B to complete the action. If I set the action for Activity A, then it works fine for Activity A, not for Activity B.

 

I want to create a single profile for two activities & maybe configure it from my code so that Data Wedge can understand from which activity it got the call & behave accordingly. Is it possible? Any idea how to implement it?

Deven Bhagwan Pawar
Hello Fahim,It is possible to

Hello Fahim,

It is possible to create a single profile for two activities and configure that profile separately for those two activities.

Make sure you include package name and both the Activities of that particular package in ActivitySelection. You can even configure barcode profile for a specific Activity using ProfileConfig API so that DataWedge can understand for which Activity you have configured what changes.

Please find the attached sample project that has two Activities (A and B) and single Profile. The Barcode device type for Activity A is set to "Auto" from the wizard and for Activity B, it is configured to "Internal_Camera_1" using Profile Config API for the same profile. So when you press scan button from Activity A, it will scan using Internal Laser. When you go to Activity B and press the scan button, it will scan using Internal_Camera_1. So this will also let you understand configuring a profile programmatically using Profile Config through your app.

Thanks

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Fahim Ahmed
Hello Deven,Thanks for your

Hello Deven,

Thanks for your helpful answer. I imported your project but couldn't run it on my TC-55 due to this error: "INSTALL_FAILED_MISSING_SHARED_LIBRARY". Any idea on that?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Deven Bhagwan Pawar
Hello Fahim,Please make sure

Hello Fahim,

Please make sure you include the respective version of EMDK library after importing the sample project.

To do that, use following steps:

1. Right Click your project

2. Select "Properties"

3. Select "Android" section on left hand side.

4. Add the respective EMDK API in the "Project Build Target".

5. Click Apply and OK.

6. Clean your project and you should be able to run the app.


Please find the attached screenshot that mentions selection of your EMDK API.


If this approach doesn't work then you need to open the command prompt or terminal, navigate to ADT-Bundle/SDK/Platform-Tools and do "adb start-server". This will restart your adb and you won't get "INSTALL_FAILED_MISSING_SHARED_LIBRARY" error after running the application. Please find the attached screenshot for this approach.

If none of the above works, you need to perform Enterprise Reset on your TC55 device and re-install EMDK for Android and follow the steps of the first approach above.


You can download specific Enterprise Reset package for TC55 device from this link:

https://portal.motorolasolutions.com/Support/US-EN/Mobile+Networks+RFID+and+BarCode+Scanners/Mobile+Computers/Handheld+C…



Thanks

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments