How to switch EMDK scanner profiles?

D Dieter Bremes 3 years 7 months ago
6 1 0

Hi

I can't get switching scanner profiles to work.

For TC8000s we created scanner profiles in Android Studio via EMDK Profile Manager. Our profiles just differ in the activated decoders. Trying to switch them like this:

final EMDKResults results = profileManager.processProfile(mProfileName, ProfileManager.PROFILE_FLAG.SET, (String[])null);
if (results.statusCode != EMDKResults.STATUS_CODE.SUCCESS) {
    if (results.statusCode == EMDKResults.STATUS_CODE.CHECK_XML) {
        if (hasStatusXmlErrors(results.getStatusString())) {
            showError(...);
        }
    } else {
        showError(...);
    }
}

processProfile() succeeds without errors and checks return the expected values:

ProfileConfig profileConfig = new ProfileConfig();
// This results in W/System.err:
final EMDKResults results2 = profileManager.processProfile(mProfileName, ProfileManager.PROFILE_FLAG.GET, profileConfig);
Log.d(TAG, "mProfileName=" + mProfileName);
Log.d(TAG, "profileConfig.profileName=" + profileConfig.profileName);
Log.d(TAG, "profileConfig.dataCapture.barcode.decoders.aztec="+ profileConfig.dataCapture.barcode.decoders.aztec);
// ...

But the scanners seem to use a default profile that is unaffected by processProfile(). Am I missing a step?

Meanwhile I switched to profileManager.processProfileAsync() - same result though.

Please Register or Login to post a reply

1 Replies

E Efkan YILMAZ

Hi, rather than using separate profiles you may want to just update the current profile's decoder settings.  There is a ready made sample showing how to do this here: GitHub - Zebra/samples-emdkforandroid-6_6 at ProfileDataCaptureSample1 .

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