Initialise scanner parameters in Android via sendBroadcast

Hi everybody,

I develop an Android / Kotlin app using scanner via DataWedge. All things works fine. When app is launched, a profile is created, with right parameters, via a sendBroadcast.

And, I made the same thing to change scanner settings, specially the "aim_type". By default, its value is "Trigger", and I'm trying to change it programatically on "Press & Release", or "Continuous reading". Via DataWedge, no problem. But the application will be install on many devices, and it should be automatic (like profile).

I'm stuck since many hours.

The code I use to do that :

private fun setScannerParameters() {

// MAIN BUNDLE PROPERTIES
   val bMain = Bundle()
   bMain.putString("PROFILE_NAME", "My Awesome App")
   bMain.putString("CONFIG_MODE", "CREATE_IF_NOT_EXIST")
   bMain.putString("PROFILE_ENABLED", "true")

   // PLUGIN_CONFIG BUNDLE PROPERTIES
   val bConfig = Bundle()
   bConfig.putString("PLUGIN_NAME", "BARCODE")
   bConfig.putString("RESET_CONFIG", "true")


   // PARAM_LIST BUNDLE PROPERTIES
   val bParams = Bundle()
   bParams.putString("aim_mode", "on")
   bParams.putString("aim_type", "3")
   // bParams.putInt("aim_timer", 5000)

   // NEST THE BUNDLE "bParams" WITHIN THE BUNDLE "bConfig"
   bConfig.putBundle("PARAM_LIST", bParams)

   // THEN NEST THE "bConfig" BUNDLE WITHIN THE MAIN BUNDLE "bMain"
   bMain.putBundle("PLUGIN_CONFIG", bConfig)

   val i = Intent()
   i.action = "com.symbol.datawedge.api.ACTION"
   i.putExtra("com.symbol.datawedge.api.SET_CONFIG", bMain)
   this.sendBroadcast(i)
}

The scanner settings on my custom profile never change.

Do you have a idea please ?

Thank you in advance

Anonymous (not verified)
Hi Remy,You are the first

Hi Remy,

You are the first person to ask about Kotlin development for Zebra devices - I am curious how much interest there is in the community for additional Kotlin resources for our devices so I put together the following sample which I believe you may find useful: GitHub - darryncampbell/DataWedgeKotlin: Demo app to show how to access Zebra's DataWedge with Kotlin .  It does not show modification of the trigger mode but does allow the user to modify the illumination mode and picklist mode so hopefully that will point you in the right direction.

Thanks,

Darryn.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Remy Lavergne
Thank for your quick reply.

Thank for your quick reply. Tomorrow, I will look about this example.

I see this : "DataWedge 6.5 or higher" to configure scanner...

I have different version of DataWedge, the lower version  is 6.4.xx on Android 6.0. I think I will update all phones to Android 7.0.

Thank you again

Rémy.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Remy Lavergne
As you said, I can modify the

As you said, I can modify the illumination mode. This settings is at the same level of aim_type. I don't understand why I can modify one and not the other : Set Config - Zebra Technologies TechDocs

Anyway, thank you very much for your help

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
I gave this a go... one thing

I gave this a go... one thing to watch out for is that aim_type only seems to work with either the hardware trigger or TOGGLE_SCANNING.  I pushed the changes to a branch but I do not planning on merging with the master: Comparing master...98851 · darryncampbell/DataWedgeKotlin · GitHub  - that will set aim type to 'press and release' whenever one of the other settings are changed.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Remy Lavergne
Thanks for your efforts My

Thanks for your efforts

My console log :

2018-10-09 11:28:36.194 640-1525/? W/ScannerFramework: [ParamBundle::SetScannerSpecificParam] Parameter 'aim_type' not found

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments