5 Replies Latest reply on Oct 9, 2018 2:31 AM by Remy Lavergne

    Initialise scanner parameters in Android via sendBroadcast

    Remy Lavergne

      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