I am developing an application for bar code scanning on hand-held devices.I am using Motorola MC 3190, on Windows Embedded Handheld 6.5.3. I am trying to programmatically enable and disable DataWedge directly from my code (let's say, to be enabled only when I am focused on a given field, and to disable it immediately when I exit the field). How to achieve this?
-
Did you find a solution for this issue? – tiago Feb 18 '16 at 08:15
3 Answers
I'm not a developer and don't know much about the barcode api. Nonetheless, I know that datawedge does not provide the best solution when you need to call the barcode scanner sometimes, and sometimes not. Datawedge is good to run all the time... We had some really bad experiences with Windows Mobile 6.5, Datawedge and MC45 in the last year...
What you can do, and I hope you do so, is access Motorola's developer page and gather some info about the barcode API, that uses a dll called, if I still have some neurons left, barcode2.dll or barcodedesign2.dll...
Best of luck!

- 231
- 3
- 12
I was able enable and disable the barcode scanner on a MC3090 running WinCE5, a MC3190 running WinCE6 and a MC3190 running WinMobile6. All of them with the same DataWedge version (3.3).
I used the DataWedge API as suggested by Human_AfterAll and followed the sample C# project bundled in the API's zip file.
The code looks something like this:
using DataWedgeLib;
(...)
dataWedgeCtrl = new DataWedgeAPI();
(...)
dataWedgeCtrl.Enable(false);
(...)
dataWedgeCtrl.Disable(false);

- 195
- 1
- 7
Sorry for coming late to answer this.. I recently worked on the implementation of barcode scanner using the JS plugin provided at
https://github.com/BlueFletch/motorola-datawedge-cordova-plugin/blob/master/README.md
Using this I was able to run the scanner on android,ios and windows mobile as well.
As per the question, yes you can start the scanner programmatically by following steps :
1) Import the plugin to your project. 2) Activate the plugin at the start of the application class to receive callbacks. 3) To start the scanner create an instance of data wedge and call "datawedge.startScanner()" And you can notice that the scanner starts lightening to detect barcodes.
As asked, we cannot deactivate/activate the data wedge depending on the text fields as it is an OS based control to automatically write text on to any edit text boxes. Instead you can handle by 1) Adding text watchers to both the edit text boxes. 2) For the edit box which you don't want to activate datawedge, when the text size is greater than 0 change it to editBox.setText(""); In this way you can handle your scenario.
Hope this helps, anything required in more detail. Do let me know.. Also mention the programming language in which you want to write the code. Am an android developer and can help you with its language code.

- 1,672
- 11
- 15