Set decoder selection via Datawedge API

// Expert user has replied.
J Joeri Klomp 9 months 3 weeks ago
158 3 0

Hello,

I am trying to modify the active profile to only enable certain decoders within particular screens in my application via the Datawedge API, but I can't get it to work.

It returns a RESULT of SUCCESS, that is the weird thing, but I can't scan any of the barcodes.

This is the code (it's for a .NET MAUI application):

Bundle mainBundle = new Bundle();
mainBundle.PutString("PROFILE_NAME", "MauiTest");
mainBundle.PutString("CONFIG_MODE", "UPDATE");

Bundle configBundle = new Bundle();
configBundle.PutString("PLUGIN_NAME", "BARCODE");

Bundle paramsBundle = new Bundle();
paramsBundle.PutString("decoder_qrcode", "true");
paramsBundle.PutString("decoder_datamatrix", "true");
paramsBundle.PutString("decoder_ean8", "true");
paramsBundle.PutString("decoder_ean13", "true");

configBundle.PutBundle("PARAM_LIST", paramsBundle);
mainBundle.PutBundle("PLUGIN_CONFIG", configBundle);

Intent intent = new Intent();
intent.SetAction("com.symbol.datawedge.api.ACTION");
intent.PutExtra("SEND_RESULT", "true");
intent.PutExtra("com.symbol.datawedge.api.SET_CONFIG", mainBundle);

SendBroadcast(intent);
Please Register or Login to post a reply

3 Replies

D David Garratt

Did you make any progress with this. One of my customers just upgraded from a Windows Mobile MC92n0 Enterprise Browser 1.8 config to an Android MC9300 with Enterprise Brower and DataWedge combo and it proved extremely difficult. Zebra seems to want you to use DataWedge API from the browser (via EB) but it did not seem to work for me and with very little to go on when it comes to diagnosing the problem.

S Sean Kennedy

Quick Question.

The profile in question "MauiTest" - when you send this enablement - do you see this change the state of these decoders in the "MauiTest" profile in Datawedge?

I ask since this Maui sample - looks close to the "Datacapture1" sample app (Android Studio) but I think you may have missed the degree of freedom for the PARAM_LIST for the Bundle Property.

Datacapture1 and the github repo can be found here:

https://techdocs.zebra.com/datawedge/13-0/guide/samples/barcode1/    { Datacapture1 app}

https://github.com/ZebraDevs/DataWedge-Android-Samples  { GitHib Repo }

 

Take a look carefully in the GIT for "MainActivity.java" and look carefully at the " btnSetDecoders.setOnClickListener();" part.
The Bundle Setup look s to me like:

profileConfig (new bundle),

barcodeConfig (new bundle),

barcodeProps (new bundle).  ( So far with your sample, above this looks good )

but... look further down.

appConfig (new bundle).  ( this is the : Action - that Puts the parsable array into the app correspondent DW Profile for DW to process.)

Its subtle - but this is why I ask if your code "Actually" changes anything.  I think the way you are intent-ing to the Broadcast Intent channel is not targeting Your Maui app DW profile, but may not be doing anything at all.

 

Hope this helps with pointing you in the direction that "Datacapture1" sample app behaves / works - for your MAUI project.

S Sean Kennedy
CONTACT
Can’t find what you’re looking for?