B4A Library DatalogicSDK for Datalogic Scanner (beta)

This is a wrap in Development for Datalogic Scanner.

As of now it is only tested on a
- Datalogic Joja Touch A6. Nearly everything is working here for me with my Joja device. Except the Keyboardmanager and all it´s functions. I just did not tried it so far...
- Datalogic Menor 1. Here some things are not working. A Menor 1 device is on it´s way to me so i can check the problem then. UPDATE: The Menor needs to have a Firmware with SDK Version 1.14 at minimum. A new Firmware will be available soon.

Other devices are not tested.

DataLogicSDK

Author: DonManfred
Version: 0.30
  • BarcodeManager
    • Events:
      • onRead (code As String, barcodetype As String)
      • onScanDeinit()
      • onScanInit()
      • onScanStarted()
      • onScanStopped()
      • onScanTimeout()
    • Functions:
      • AddReadListener
      • AddStartListener
      • AddStopListener
      • AddTimeoutListener
      • commitProperties As Int
      • CreateReadListener
      • CreateStartListener
      • CreateStopListener
      • CreateTimeoutListener
      • enableAllSymbologies (enable As Boolean) As Int
      • enableSymbology (barcodeType As String, enable As Boolean) As Int
      • GetProperties (b4alist As List)
      • Initialize (EventName As String) As MyMap
      • isInitialized As Boolean
        Checks if the Scanner Service is correctly initialized.
        Return type: @return:<code>int</code> {@link DecodeException#SUCCESS} in case of success,
        otherwise a possible error code, matching one of the {@link DecodeException} error constants.
      • isSymbologyEnabled (barcodeType As String) As Boolean
      • isSymbologySupported (barcodeType As String) As Boolean
      • pressTrigger As Int
      • release As Int
      • releaseTrigger As Int
      • RemoveReadListener
        ReadListener
      • RemoveStartListener
        StartListener
      • RemoveStopListener
        StopListener
      • RemoveTimeoutListener
        TimeoutListener
      • startDecode As Int
        Get String Property from Batterymanager
      • startDecode2 (timeout As Int) As Int
      • stopDecode As Int
    • Properties:
      • dnotification As com.datalogic.decode.configuration.DecodingNotification [read only]
      • ean8 As com.datalogic.decode.configuration.Ean8 [read only]
      • Editor As com.datalogic.device.configuration.PropertyEditor [read only]
      • Formatting As com.datalogic.decode.configuration.Formatting [read only]
      • goodread As com.datalogic.decode.configuration.GoodRead [read only]
      • intentWedge As com.datalogic.decode.configuration.IntentWedge [read only]
      • LedGOODREAD As com.datalogic.device.notification.Led [read only]
      • LedGREENSPOT As com.datalogic.device.notification.Led [read only]
      • LedNOTIFICATION As com.datalogic.device.notification.Led [read only]
      • scannerOptions As com.datalogic.decode.configuration.ScannerOptions [read only]
  • BatteryStatus
    • Functions:
      • Initialize (EventName As String)
      • IsInitialized As Boolean
    • Properties:
      • BatteryStateOfHealth As Int [read only]
      • CapacityFull As Int [read only]
      • CapacityRemaining As Int [read only]
      • ChargeCurrentMax As Int [read only]
      • DischargeCurrentMax As Int [read only]
      • TemperatureMax As Int [read only]
      • TemperatureMin As Int [read only]
      • TimeToEmpty As Int [read only]
  • DecodingNotification
    • Functions:
      • Initialize (EventName As String, manager As com.datalogic.device.configuration.PropertyGetter)
      • IsInitialized As Boolean
      • store (to As com.datalogic.device.configuration.PropertyEditor, persist As Boolean)
    • Properties:
      • goodReadAudioFile As String
      • goodReadAudioMode As String
      • goodReadCount As Int
      • goodReadDuration As Int
      • goodReadInterval As Int
  • Ean8
    • Functions:
      • convertToEan13 As Boolean
      • Initialize (EventName As String, manager As com.datalogic.device.configuration.PropertyGetter)
      • IsInitialized As Boolean
      • store (to As com.datalogic.device.configuration.PropertyEditor, persist As Boolean)
    • Properties:
      • enable As Boolean
      • sendChecksum As Boolean [write only]
  • Formatting
    • Functions:
      • enableexternalFormatting (value As Boolean)
      • Initialize (EventName As String, manager As com.datalogic.device.configuration.PropertyGetter)
      • IsInitialized As Boolean
      • removeNonPrintableChars (value As Boolean)
      • store (to As com.datalogic.device.configuration.PropertyEditor, persist As Boolean)
    • Properties:
      • gsSubstitution As String [write only]
      • labelPrefix As String [write only]
      • labelSuffix As String [write only]
  • GoodRead
    • Functions:
      • Initialize (EventName As String, manager As com.datalogic.device.configuration.PropertyGetter)
      • IsInitialized As Boolean
      • store (to As com.datalogic.device.configuration.PropertyEditor, persist As Boolean)
    • Properties:
      • goodReadEnable As Boolean
      • goodReadLedEnable As Boolean
      • goodReadVibrateEnable As Boolean
      • greenSpotEnable As Boolean
  • IntentDeliveryModes
    • Fields:
      • BROADCAST As com.datalogic.decode.configuration.IntentDeliveryMode
      • START_ACTIVITY As com.datalogic.decode.configuration.IntentDeliveryMode
      • START_SERVICE As com.datalogic.decode.configuration.IntentDeliveryMode
  • IntentWedge
    • Functions:
      • Initialize (EventName As String, manager As com.datalogic.device.configuration.PropertyGetter)
      • IsInitialized As Boolean
      • store (to As com.datalogic.device.configuration.PropertyEditor, persist As Boolean)
    • Properties:
      • Action As String
      • Category As String
      • DeliveryMode As String
      • Enable As Boolean
      • extraBarcodeData As String
      • extraBarcodeString As String
      • extraBarcodeType As String
  • KeyboardManager
    • Functions:
      • clearAllMappings As Int
        Removes all the configured mappings. Whenever this method is called, all
        the current active mappings are cleared and removed.
        Return type: @return:<code>int</code> {@link DeviceException#SUCCESS} in case of success,
        otherwise a possible error code, matching one of the {@link DeviceException} error constants.
      • clearMapping (scanCode As com.datalogic.device.input.VScanEntry) As Int
        Removes a single active mapping. The current active mapping for the
        selected {@link com.datalogic.device.input.VScanEntry}, if
        existing, is removed.
        scanCode: a {@link VScanEntry} representing the virtual scan code, mapped that must be removed.
        Return type: @return:<code>int</code> {@link DeviceException#SUCCESS} in case of success,
        otherwise a possible error code, matching one of the {@link DeviceException} error constants.
      • disableKey (scanCode As com.datalogic.device.input.VScanEntry, disable As Boolean) As Int
        Disables completely a single physical key, through the {@link com.datalogic.device.input.VScanEntry} data structure.
        When a key is disabled, no input will be produced whenever key presses are detected. When a key is again re-enabled,
        is reset to its original value, so any previous mapping is automatically lost.
        scanCode: a {@link VScanEntry} representing the virtual scan code, associated to the physical key.
        disable: a <code>boolean</code> that specifies whether or not the key will be disabled.
        Return type: @return:<code>int</code> {@link DeviceException#SUCCESS} in case of success,
        otherwise a possible error code, matching one of the {@link DeviceException} error constants.
      • getIntent (scanCode As com.datalogic.device.input.VScanEntry) As Intent
        Returns current mapping between a physical key and an Intent.
        scanCode: a {@link VScanEntry} representing the virtual scan code.
        Return type: @return:Intent used to launch an Android activity through the
        Context.startActivity(Intent intent) method. Returns null in case
        there is no association.
      • getKeyCode (scanCode As com.datalogic.device.input.VScanEntry) As com.datalogic.device.input.KeyCodeEntry
        Returns current mapping between a physical scan code key and an Android key code.
        scanCode: a {@link VScanEntry} representing the virtual scan code.
        Return type: @return:{@link KeyCodeEntry} representing an Android key code and meta state. Returns null in case there
        is no association.
      • getUnicode (scanCode As com.datalogic.device.input.VScanEntry) As Character
        Returns current mapping between a physical key and a unicode character.
        scanCode: a {@link VScanEntry} representing the virtual scan code.
        Return type: @return:unicode character. Returns null in case there is no association.
      • Initialize
      • isKeyDisabled (scanCode As com.datalogic.device.input.VScanEntry) As Boolean
        Checks if a physical key is disabled.
        scanCode: a {@link VScanEntry} representing the virtual scan code, associated to the physical key.
        Return type: @return:<code>boolean</code> True in case the key is disabled, false otherwise or in case of error.
      • lockInput (lock As Boolean) As Int
        Locks or unlocks the input from keyboard and physical buttons.
        lock: <code>boolean</code> it specifies whether or not the keyboard will be locked.
        Return type: @return:<code>int</code> {@link DeviceException#SUCCESS} in case of success,
        otherwise a possible error code, matching one of the {@link DeviceException} error constants.
      • mapIntent (scanCode As com.datalogic.device.input.VScanEntry, intent As Intent) As Int
        Assigns an Intent to a physical key. If a mapping for the desired
        physical key is already assigned and saved, it will be overridden.
        scanCode: a {@link VScanEntry} representing the virtual scan code.
        intent: Intent used to launch an Android activity through the
        Context.startActivity(Intent intent) method. <br>
        <br>
        Example code to make Camera Activity capture an image on the
        front scan trigger pressure:<br>
        <code>(new KeyboardManager()).mapIntent(new VScanEntry(VScanCode.VSCAN_FRONT_TRIGGER), new Intent(MediaStore.ACTION_IMAGE_CAPTURE));</code>
        <br>
        <br>
        Example code to make BarcodeManager capture a barcode on the
        front scan trigger pressure and to stop capturing on the front
        scan trigger release:<br>
        <code>(new KeyboardManager()).mapIntent(new VScanEntry(VScanCode.VSCAN_FRONT_TRIGGER), new Intent(BarcodeManager.ACTION_START_DECODE));</code>
        <br>
        <br>
        Return type: @return:<code>int</code> {@link DeviceException#SUCCESS} in case of success,
        otherwise a possible error code, matching one of the {@link DeviceException} error constants.
      • mapKeyCode (scanCode As com.datalogic.device.input.VScanEntry, keyCode As com.datalogic.device.input.KeyCodeEntry) As Int
        Assigns a virtual key code to a physical key. If a mapping for the
        desired physical key is already assigned and saved, it will be
        overridden.
        scanCode: a {@link VScanEntry} representing the virtual scan code.
        keyCode: a {@link KeyCodeEntry} representing the Android key code and meta state. <br>
        <br>
        Example code to avoid any keyboard event on the left scan
        trigger pressure:<br>
        <code>(new KeyboardManager()).mapKeyCode(new VScanEntry(VScanCode.VSCAN_LEFT_TRIGGER), new KeyCodeEntry(KeyEvent.KEYCODE_UNKNOWN));</code>
        <br>
        <br>
        Example code to map the left scan trigger to the Android left
        trigger button key code:<br>
        <code>(new KeyboardManager()).mapKeyCode(new VScanEntry(VScanCode.VSCAN_LEFT_TRIGGER), new KeyCodeEntry(KeyEvent.KEYCODE_BUTTON_L1));</code>
        <br>
        <br>
        Example code to map the enter key to the Android home key
        code:<br>
        <code>(new KeyboardManager()).mapKeyCode(new VScanEntry(VScanCode.VSCAN_RIGHT_ENTER), new KeyCodeEntry(KeyEvent.KEYCODE_HOME));</code>
        <br>
        <br>
        Return type: @return:<code>int</code> {@link DeviceException#SUCCESS} in case of success,
        otherwise a possible error code, matching one of the {@link DeviceException} error constants.
      • mapUnicode (scanCode As com.datalogic.device.input.VScanEntry, c As Character) As Int
        Assigns a unicode character to a physical key. If a mapping for the
        desired physical key is already assigned and saved, it will be
        overridden.
        scanCode: a {@link VScanEntry} representing the virtual scan code.
        c: unicode character <br>
        <br>
        Example code to assign a Thai unicode character to the
        physical key '1':<br>
        <code>(new KeyboardManager()).mapUnicode(new VScanEntry(VScanCode.VSCAN_1), '\\u0e01');</code>
        <br>
        <br>
        Return type: @return:<code>int</code> {@link DeviceException#SUCCESS} in case of success,
        otherwise a possible error code, matching one of the {@link DeviceException} error constants.
    • Properties:
      • AvailableTriggers As java.util.List [read only]
        Returns the available triggers in the device.
      • InputLocked As Boolean [read only]
        Tells if the input from keyboard is locked.
      • KeyboardLayout As Int(,) [read only]
        Returns the physical keyboard layout. It can be used by application for
        keyboard remapping.
      • MappedIntents As java.util.Map [read only]
        Provides a {@link java.util.Map}<
        {@link com.datalogic.device.input.VScanEntry},
        {@link <a href="http://developer.android.com/reference/android/content/Intent.html">android.content.Intent</a>}
        > containing all the stored and active Android Intent mappings.
      • MappedKeyCodes As java.util.Map [read only]
        Provides a {@link java.util.Map}<
        {@link com.datalogic.device.input.VScanEntry}, {@link com.datalogic.device.input.KeyCodeEntry}>
        containing all the stored and active Android key codes mappings.
      • MappedUnicodes As java.util.Map [read only]
        Provides a {@link java.util.Map}<
        {@link com.datalogic.device.input.VScanEntry},
        {@link java.lang.Character}> containing all the stored and active
        Character mappings.
  • KeyboardWedge
    • Functions:
      • Initialize (EventName As String, manager As com.datalogic.device.configuration.PropertyGetter)
      • IsInitialized As Boolean
      • store (to As com.datalogic.device.configuration.PropertyEditor, persist As Boolean)
    • Properties:
      • Enable As Boolean
      • onlyOnFocus As Boolean
      • wedgeMode As String
        Either "TEXT_INJECTION" or "KEY_PRESSURE"
  • LedManager
    • Functions:
      • blinkLed (id As com.datalogic.device.notification.Led, count As Int, onMS As Int, offMS As Int) As Int
      • blinkLed2 (id As com.datalogic.device.notification.Led, ARGB As Int, count As Int, onMS As Int, offMS As Int) As Int
      • Initialize (EventName As String)
      • IsInitialized As Boolean
      • setLed (id As com.datalogic.device.notification.Led, enable As Boolean) As Int
      • setLed2 (id As com.datalogic.device.notification.Led, enable As Boolean, ARGB As Int) As Int
  • ManufacturerInfo
    • Functions:
      • Initialize (EventName As String)
      • IsInitialized As Boolean
    • Properties:
      • Manufacturer As String [read only]
      • ModelName As String [read only]
      • ProductionMonth As Int [read only]
      • ProductionWeek As Int [read only]
      • ProductionYear As Int [read only]
      • SerialNumber As String [read only]
      • Technology As String [read only]
  • PowerManager
    • Functions:
      • activateWakeup (source As com.datalogic.device.power.WakeupSource) As Int
      • clearWakeup (source As com.datalogic.device.power.WakeupSource) As Int
      • getSuspendTimeout (externalPower As Boolean) As Int
      • Initialize (EventName As String)
      • IsInitialized As Boolean
      • isWakeupSupported (source As com.datalogic.device.power.WakeupSource) As Boolean
      • reboot (resetType As com.datalogic.device.BootType) As Int
      • setSuspendTimeout (timeout As com.datalogic.device.power.SuspendTimeout, externalPower As Boolean) As Int
    • Properties:
      • RebootReason As String [read only]
  • ScannerOptions
    • Functions:
      • Initialize (EventName As String, manager As com.datalogic.device.configuration.PropertyGetter)
      • IsInitialized As Boolean
      • store (to As com.datalogic.device.configuration.PropertyEditor, persist As Boolean)
    • Properties:
      • aimEnable As Boolean
      • decodeTimeout As Int
      • displayModeEnable As Boolean
      • illuminationEnable As Boolean
      • picklistEnable As Boolean
      • targetMode As String
        One of "TARGET_TIMEOUT" or "RELEASE_SCAN"
  • ToneNotificationModes
    • Fields:
      • AUDIO_FILE As com.datalogic.decode.configuration.ToneNotificationMode
      • BEEP As com.datalogic.decode.configuration.ToneNotificationMode
      • NONE As com.datalogic.decode.configuration.ToneNotificationMode
  • Trigger
    • Fields:
      • TRIGGER_ID_AUTOSCAN As Int
        ID for AutoScan trigger.
      • TRIGGER_ID_FRONT As Int
        ID for Front trigger.
      • TRIGGER_ID_LEFT As Int
        ID for Left trigger.
      • TRIGGER_ID_MOTION As Int
        ID for Motion trigger.
      • TRIGGER_ID_PISTOL As Int
        ID for Pistol trigger.
      • TRIGGER_ID_RIGHT As Int
        ID for Right trigger.
Requirements:
- A Datalogic Scanner with SDK Version 1.14+


Please create a new thread in the questionsforum for any Issue or Question you have.
 

Attachments

  • datalogicsdkV0.18.zip
    125.6 KB · Views: 245
  • DatalogicSDKExample.zip
    152.7 KB · Views: 290
  • datalogicsdkV0.25.zip
    147.2 KB · Views: 249
  • datalogicsdkV0.30.zip
    182.6 KB · Views: 280
Last edited:

scsjc

Well-Known Member
Licensed User
Longtime User
A very interesting library ;)

Your JOJA DEVICE is this attached to the image?
if it is not, you could pass me a link to see what it is, I would be interested in buying one to do tests

Thank you
Captura.JPG
 

johan vetsuypens

Member
Licensed User
Longtime User
FYI : 'Joya Touch A6' and 'Memor 1' have the exact physical dimensions and looks. Also their accessories are identical.

Joya Touch A6 : Android 7.1 No GMS : https://www.datalogic.com/eng/retai...ns/mobile-computers/joya-touch-a6-pd-820.html
Memor 1 : Android 8.1 with GMS : https://www.datalogic.com/eng/retail-transportation-logistics/mobile-computers/memor-1-pd-844.html

Joya Touch A6 is more useful in a selfshopping environment like :
https://www.nixor.ee/wp-content/upl...ipääsusüsteem-turvatehnoloogia-joya-touch.png
 

johan vetsuypens

Member
Licensed User
Longtime User
Yes. They are called cradles. They are used for wireless charging of the devices. Also, these cradles have a locking mechanism. From the Joya SDK (via NFC) you can unlock the Joya out of the cradle. It can't be removed without a software action. Datalogic has 2 types of cradles. With or without locking of the device.
 
Top