CipherLab RK25 User Manual

CipherLab RK25 User Manual

Android programming
Hide thumbs Also See for RK25:
Table of Contents

Advertisement

Android Programming
for RK25/RS30/RS31/RS50/RS51/9700A
Mobile Computers
Version 1.13

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the RK25 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for CipherLab RK25

  • Page 1 Android Programming for RK25/RS30/RS31/RS50/RS51/9700A Mobile Computers Version 1.13...
  • Page 2 CIPHERLAB and the client and remains the exclusive property of CIPHERLAB CO., LTD. If you find any problems in the documentation, please report them to us in writing. CIPHERLAB does not warrant that this document is error-free.
  • Page 3: Release Notes

     Modified: 1.5.1 Preferences – triggerPresentationModeTrigger 1.11 Jun. 07, 2018  added to Get_UserPreferences/Set_UserPreferences Modified: 1.5.1 Preferences – descriptions for RK25 series not  supporting Presentation Mode added to the Get_UserPreferences Remarks item Modified: 1.5.2 Symbology Settings – "SecurityLevel ...
  • Page 4 Modified: 1.5.1 – change “InverseType.Autodetect” to 1.07 Apr. 12, 2017  “InverseType.AutoDetect” (Get_UserPreferences) Modified: 1.5.1 – Continuous and Presentation modes for  timeoutBetweenSameSymbology Modified: 1.5.1 – Replace “0x06” with  “InterCharacterGapSize.Normal” of Get_UserPreferences Modified: 1.5.1 – Replace “0x0A” with  “InterCharacterGapSize.Large”...
  • Page 5 1.3.1 Get_ReaderOutputConfiguration - replace Enable_State 1.01 Oct. 12, 2015  with KeyboardEmulationType 1.3.1 Set_ReaderOutputConfiguration - replace Enable_State  with KeyboardEmulationType 1.5.1 Get_UserPreferences TriggerType.PulseMode,  BlinkingMode, HostMode, PresentationMode removed 1.5.2 Get_Symbology - Codabar, GS1DataBarLimited updated  1.5.3 - Codabar Class updated ...
  • Page 6: Table Of Contents

    CONTENTS RELEASE NOTES ........................- 3 - INTRODUCTION........................1 Development Tool ........................2 BARCODE READER API ......................3 1.1. Import Library ..................... 4 1.1.1 Android Studio ....................4 1.1.2 Eclipse ........................7 1.1.3 Xamarin for Visual Studio 2015 ..............11 1.2.
  • Page 7 1.5.23. UpcA Class ......................56 1.5.24. UpcE Class ......................57 1.5.25. UpcE1 Class ......................58 1.5.26. Composite Class ....................59 1.5.27. USPostal Class ....................60 1.5.28. UKPostal Class....................60 1.5.29. JapanPostal Class ..................... 61 1.5.30. AustralianPostal Class ..................61 1.5.31. DutchPostal Class ....................
  • Page 8 RESPONSE CODE INSTRUCTIONS ................. 85 SCAN ENGINE SETTINGS ....................87 Symbologies Supported ......................88 Configurable Symbology Properties ................... 90 CODE TYPE & SYMBOLOGY ....................95 ADC PROFILE DEPLOYMENT ..................... 99 General Deployment ......................... 99 Deployment for Barcode Reader, AppLock, Terminal Emulation ......99 Deployment for File Transfer ....................
  • Page 9: Introduction

    INTRODUCTION This Programming Guide contains necessary information for building Android applications that can tune reader module(s), capture data, or control built-in hardware on CipherLab mobile computers, which are powered by Android. Android Framework makes it easy to create such applications. Simply import the prospective Android component (Android Class Library) to your Android application to make your way to build it.
  • Page 10: Development Tool

    Android Programming Guide DEVELOPMENT TOOL Before developing Android applications, programmers are supposed to make their machine ready with the requirements as follows: Java SE Development Kit (JDK, Java SE 7 or greater is recommended)  Android SDK  Android Studio, Eclipse IDE, or Xamarin for Visual Studio ...
  • Page 11: Barcode Reader Api

    Chapter 1 BARCODE READER API Before developing your self-made application, the offered “barcodeapi_vx_x_xx.jar” or “barcodeapi_vx_x_xx.dll” library file has to be imported into your project. Library Required Location Barcodeapi_vx_x_xx.jar (for Android Studio or Eclipse) /sdcard/ReaderService_data Barcodeapi_vx_x_xx.dll (for Xamarin) IN THIS CHAPTER 1.1 Import Library ..............
  • Page 12: Import Library

    Android Programming Guide 1.1. IMPORT LIBRARY 1.1.1 ANDROID STUDIO 1) After creating an Android Studio project, click the Android project view icon to switch to the Traditional project view. Android project view Traditional project view 2) Locate the offered “barcodeapi.jar” library file in your file system and copy it. 3) Right-click on the libs folder in the project view, and then select Paste.
  • Page 13 Chapter 1 Barcode Reader API 4) A dialog shows up indicating the file name and the destination directory to be copied. Click the OK button to start importing the library file. 5) In the project view, you can see the library is imported. If you don’t see any files listed under the barcodeapi.jar item, please click the Sync Project with Gradle Files button from the toolbar.
  • Page 14 Android Programming Guide After the project sync completes, the files relating to the library will be displayed. 6) Finally, import the packages by manually typing statements as follows to finish the library import process: import com.cipherlab.barcode.*; import com.cipherlab.barcodebase.*; import com.cipherlab.barcode.decoder.*; import com.cipherlab.barcode.decoderparams.*;...
  • Page 15: Eclipse

    Chapter 1 Barcode Reader API 1.1.2 ECLIPSE Have the library file (barcodeapi.jar) be ready on the file system. And then follow the instructions below: 1) In the Project Explorer view, right-click the libs folder in your Android project and then select Import. 2) With the Import dialog showing up, select General ->...
  • Page 16 Android Programming Guide 3) Click the Browse button to locate the library file. 4) For example, “D:\Import Library” is the destination directory where the library file is located. Check the .JAR file in the right pane and click the Finish button. You will see the library has been imported into your project.
  • Page 17 Chapter 1 Barcode Reader API 5) If the library is not on your build path, please right-click on the project name and then select Build Path -> Configure Build Path on the pop-up menu. 6) After the project properties window shows up, click the Libraries tab and then click the Add JARs button.
  • Page 18 Android Programming Guide 7) Select the JAR file you’ve just imported. Click the OK button. 8) Now the library is on the build path.
  • Page 19: Xamarin For Visual Studio 2015

    Chapter 1 Barcode Reader API 1.1.3 XAMARIN FOR VISUAL STUDIO 2015 1) Download Xamarin from http://store.xamarin.com and install it. 2) Open Visual Studio on your PC to create a new project. 3) Select File  New  Project and then choose the C#  Windows  Android  Blank APP (Android) project template.
  • Page 20 Android Programming Guide 5) In the right pane of Visual Studio, right-click on References and then select Add Reference under the name of the new project. 6) In the Reference Manager dialog, click Browse in the left pane and then click the Browse button to locate the library file.
  • Page 21 Chapter 1 Barcode Reader API 7) Include the “using Com.Cipherlab.Barcode;” statement in MainActivity.cs.
  • Page 22: Initialize/Identify Reader

    Android Programming Guide 1.2. INITIALIZE/IDENTIFY READER 1.2.1. INITIALIZATION InitInstance Purpose Creates a ReaderManager instance before employing any APIs. Syntax ReaderManager InitInstance (Context context); Example private ReaderManager mReaderManager; mReaderManager = ReaderManager.InitInstance(this); Return Value Gets a ReaderManager instance if successful, else null. Remarks As this is a function that gets reader module(s) ready, it must be called before any other functions.
  • Page 23: Active Device

    Chapter 1 Barcode Reader API 1.2.2. ACTIVE DEVICE GetActive Purpose Gets the reader active state. boolean GetActive (); Syntax Example boolean bRet = mReaderManager.GetActive(); Return Value If successful, it returns the reader active state accordingly: false Disable true Enable See Also InitInstance, SetActive, GetReaderType SetActive Purpose...
  • Page 24: Reader Type

    Android Programming Guide 1.2.3. READER TYPE GetReaderType Purpose Gets the available reader type(s) BcReaderType GetReaderType (); Syntax Example BcReaderType myReaderType = mReaderManager.GetReaderType(); Return Value If successful, it returns the reader type(s) accordingly: Moto_1D_SE955 Moto_2D_4500 Moto_1D_SE965 Moto_2D_PL4507 Intermec_2D_EX25 Moto_1D_SE1524 CL_1D_SM1 SE4750SR_2D SE4750MR_2D Moto_1D_SE965I Moto_1D_SE965E...
  • Page 25: Obtain Data

    Chapter 1 Barcode Reader API 1.3. OBTAIN DATA 1.3.1. DATA OUTPUT SETTINGS Processed Data Set_ReaderOutputConfiguration() sets which info to attach to a decoded barcode data: Info Description Code Type Barcode Type. See Set_ReaderOutputConfiguration() paramenter showCodeType. Prefix Code No prefix code if value is 0. See Set_ ReaderOutputConfiguration() parameter szPrefixCode.
  • Page 26 Android Programming Guide [in][out] A value that specifies the character to auto-affix. OutputEnter.None None OutputEnter.Return *Carriage Return (= 0x0d) OutputEnter.Tab OutputEnter.Comma Comma (= 0x2c) OutputEnter.Semicolon Semicolon (= 0x3b) Enable_State showCodeType [in][out] A value that specifies whether to transmit barcode type in data records. Enable_State.FALSE *Does not transmit Enable_State.TRUE Transmits...
  • Page 27 Chapter 1 Barcode Reader API Remarks Depending on reader type and associated reader setting, the fields of output record may differ. When data comes from barcode reader, data fields may include: [Code Type][Prefix Code][Decode Data][Suffix Code][Code Length] [Code Type]: This field is output only when showCodeType value is TRUE. [Prefix Code]: This field is output only when szPrefixCode is non-zero.
  • Page 28 Android Programming Guide OutputEnter.Comma Comma (= 0x2c) OutputEnter.Semicolon Semicolon (= 0x3b) Enable_State showCodeType [in][out] A value that specifies whether to transmit barcode type in data records. Enable_State.FALSE *Does not transmit Enable_State.TRUE Transmits Enable_State showCodeLen [in][out] A value that specifies whether to transmit code length for a barcode in data records.
  • Page 29 Purpose Emulates the behaviour of physical trigger key. The following steps have to be done beforehand: 1. Register for the CipherLab-specific string – com.cipherlab.barcode.GeneralString.Intent_SOFTTRIGGER_DATA – by calling the android.content.ContextWrapper.registerReceiver function. 2. Receive the registered string by calling the Android BroadcastReceiver() function.
  • Page 30 Android Programming Guide Example public class MainActivity extends Activity { private IntentFilter filter; Button b1 = null; ReaderManager m_RM = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); b1 = (Button) findViewById(R.id.button1); b1.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (m_RM != null) m_RM.SoftScanTrigger();...
  • Page 31: Reader Service Version

    Chapter 1 Barcode Reader API 1.3.2. READER SERVICE VERSION Get_BarcodeServiceVer Purpose Obtains the reader service version. String Get_BarcodeServiceVer (); Syntax Example String ver = mReaderManager.Get_BarcodeServiceVer(); 1.3.3. READER API VERSION GetBarcodeAPIVersion Purpose Obtains the reader API version. String GetBarcodeAPIVersion (); Syntax Example String ver = mReaderManager.GetBarcodeAPIVer();...
  • Page 32: Manipulate Status Indication

    Android Programming Guide 1.4. MANIPULATE STATUS INDICATION The device auto-signals the receipt of a successful decoding by a sound or vibration according to NotificationParams() settings. Before calling Set_xxx functions, users are supposed to call Get_xxx functions to retrieve the current reader service settings. 1.4.1.
  • Page 33 Chapter 1 Barcode Reader API Return Value If successful, it returns ClResult.S_OK. Otherwise, it returns ClResult.S_ERR. See Also Set_NotificationParams Set_NotificationParams Purpose Configures notification settings. Syntax ClResult Set_NotificationParams (NotificationParams settings) Parameters A default value comes with an asterisk “*”. BeepType ReaderBeep [in][out] A value that specifies the sound to play.
  • Page 34: Configure Scan Engine

    Android Programming Guide Return Value If successful, it returns ClResult.S_OK. Otherwise, it returns ClResult.S_ERR. See Also Get_NotificationParams 1.5. CONFIGURE SCAN ENGINE 1.5.1. PREFERENCES Get_Decoders_Status Purpose Gets symbology status (enabled or disabled) of the reader. Syntax ClResult Get_Decoders_Status (Readers settings) Parameters [in][out] Each value specifies whether the reader is able to decode the corresponding symbology.
  • Page 35 Chapter 1 Barcode Reader API Enable_State.TRUE *Enabled Enable_State enableCode128 Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableCodabar Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableChinese2Of5 Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableDataMatrix Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableDutchPostal Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableEanJan8 Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableEanJan13...
  • Page 36 Android Programming Guide Enable_State.TRUE *Enabled Enable_State enableIsbt128 Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableIndustrial2Of5 Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableInterleaved2Of5 Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableJapanPostal Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableKorean3Of5 Enable_State.FALSE *Disabled Enable_State.TRUE Enabled Enable_State enableMatrix2Of5 Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableMaxiCode Enable_State.FALSE Disabled...
  • Page 37 Chapter 1 Barcode Reader API Enable_State.TRUE *Enabled Enable_State enableTriopticCode39 Enable_State.FALSE *Disabled Enable_State.TRUE Enabled Enable_State enableUpcA Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableUpcE Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableUpcE1 Enable_State.FALSE *Disabled Enable_State.TRUE Enabled Enable_State enableUccCoupon Enable_State.FALSE *Disabled Enable_State.TRUE Enabled Enable_State enableUKPostal Enable_State.FALSE Disabled Enable_State.TRUE *Enabled Enable_State enableUPUFICSPostal...
  • Page 38 Android Programming Guide Remarks Enable_State.FALSE means the reader is disabled to decode the symbology. Enable_State.TRUE means the reader is enabled to decode the symbology. See Also Get_Decoders_Status Set_Decoders_Status Purpose Sets symbology status (enabled or disabled) of the reader. Syntax ClResult Set_Decoders_Status (Decoders settings) Parameters 42 symbologies are supported.
  • Page 39 Chapter 1 Barcode Reader API Enable_State.TRUE Enables int laserOnTime [in][out] A value that specifies the maximum time for decoding a printed barcode during a scan act. 500 ~ 9900 *3000 (millisecond) InverseType negativeBarcodes [in][out] A value that specifies the negative barcode status. InverseType.RegularOnly *Regular barcode InverseType.InverseOnly...
  • Page 40 Android Programming Guide [in][out] A value that specifies scan angle. ScanAngleType.Narrow Narrow Angle (35 degrees) ScanAngleType.Wide *Wide Angle (47 degrees) SecurityLevel securityLevel [in][out] A value that specifies decode security level, which is useful to fix some printed quality issues when reading delda barcodes such as Code 128, Code 93, UPC/EAN.
  • Page 41 Chapter 1 Barcode Reader API Enable_State.FALSE Disables the trigger key control for Presentation mode Enable_State.TRUE *Enables the trigger key control for Presentation mode Enable_State decodingillumniation [in][out] A value that specifies whether to provide flash illumination during every barcode capture to aid decoding. Enable_State.FALSE Disables decding illumination Enable_State.TRUE...
  • Page 42 0 ~ 100 *0 (no tolerance allowed) Return Value If successful, it returns ClResult.S_OK. Otherwise, it returns ClResult.S_ERR. Remarks RK25 Series don’t support Presentation Mode. Example UserPreference settings = new UserPreference(); mReaderManager.Get_UserPreferences(settings); if (Enable_State.NotSupport == settings.displayMode) See Also Set_UserPreferences...
  • Page 43: Symbology Settings

    Chapter 1 Barcode Reader API settings.addonSecurityLevel = 2; settings.laserOnTime = 3000; settings.negativeBarcodes = InverseType.AutoDetect; settings.scanAngle = ScanAngleType.Wide; if (ClResult.S_ERR == mReaderManager.Set_UserPreferences(settings)) Toast.makeText(this, "Set_UserPreferences was failed", Toast.LENGTH_SHORT).show(); else Toast.makeText(this, "Set_UserPreferences was successful", Toast.LENGTH_SHORT).show(); See Also Get_UserPreferences 1.5.2. SYMBOLOGY SETTINGS Get_Symbology Purpose Gets symbology settings by implementing a symbology interface instance.
  • Page 44 Android Programming Guide int length2; Enable_State checkDigitVerification; Enable_State transmitCheckDigit; Enable_State fullASCII; Enable_State convertToCode32; Enable_State convertToCode32Prefix; TriopticCode39 Enable_State enable; Korean3Of5 Enable_State enable; Code93 Enable_State enable; int length1; int length2; Code128 Code128SecurityLevel securitylevel; Enable_State enable; int length1; int length2; GS1128 Enable_State enable; String fieldSeparator;...
  • Page 45 Chapter 1 Barcode Reader API Chinese2Of5 Enable_State enable; Industrial2Of5 Enable_State enable; int length1; int length2; Interleaved2Of5 Enable_State enable; int length1; int length2; Enable_State checkDigitVerification; Enable_State transmitCheckDigit; Enable_State convertToEan13; SecurityLevel securitylevel; Matrix2Of5 Enable_State enable; int length1; int length2; int redundancy; Enable_State checkDigitVerification; Enable_State transmitCheckDigit;...
  • Page 46 Android Programming Guide int securityLevel; Enable_State enable; Enable_State convertToUpcEan; GS1DataBarExpanded Enable_State enable; String fieldSeparator; //ranging from 0 to 127 int securityLevel; Enable_State enable; int length1; int length2; MsiDigitOption checkDigitOption; Enable_State transmitCheckDigit; DigitAlgorithm checkDigitAlgorithm; Ean8 Enable_State enable; AddonsType addon2; AddonsType addon5; Enable_State transmitCheckDigit;...
  • Page 47 Chapter 1 Barcode Reader API AddonsType addon2; AddonsType addon5; Enable_State transmitCheckDigit; Preamble transmitSystemNumber; Enable_State convertToEan13 UpcE Enable_State enable; AddonsType addon2; AddonsType addon5; Enable_State transmitCheckDigit; Preamble transmitSystemNumber; Enable_State convertToUpcA; UpcE1 Enable_State enable; AddonsType addon2; AddonsType addon5; Enable_State transmitCheckDigit; Preamble transmitSystemNumber; Enable_State convertToUpcA; Composite Enable_State enableCc_C;...
  • Page 48 Android Programming Guide Enable_State transmitCheckDigit; JapanPostal Enable_State enable; AustralianPostal Enable_State enable; DutchPostal Enable_State enable; USPSPostal Enable_State enable; UPUFICSPostal Enable_State enable; PDF417 Enable_State enable; TransmitMode transmitMode; char escapeCharacter; Enable_State transmitControlHeader; MicroPDF417 Enable_State enable; Enable_State code128Emulation; DataMatrix Enable_State enable; String fieldSeparator; //ranging from 0 to 127...
  • Page 49 Chapter 1 Barcode Reader API MatrixMirrorImage mirrorImage; MaxiCode Enable_State enable; QRCode Enable_State enable; MicroQR Enable_State enable; Aztec Enable_State enable; Return Value If successful, it returns ClResult.S_OK. Otherwise, it returns ClResult.S_ERR. Remarks length1 and length2 are integers ranging from 0 to 55 Example Codabar settings = new Codabar();...
  • Page 50: Codabar Class

    Android Programming Guide Example Codabar settings = new Codabar(); Codabar.enable = Enable_State.TRUE; if (ClResult.S_ERR == mReaderManager.Set_Symbology(settings)) Toast.makeText(this, "Set_Symbology was failed", Toast.LENGTH_SHORT).show(); else Toast.makeText(this, "Set_Symbology was successful", Toast.LENGTH_SHORT).show(); See Also Get_Symbology 1.5.3. CODABAR CLASS public class Codabar public Enable_State transmitCheckDigit; public CodabarDigitAlgorithm verifyCheckDigit; public NOTISEditingType notisEditingType;...
  • Page 51: Code11 Class

    Chapter 1 Barcode Reader API ABCD_Upper Abcd_Lower Enable_State enable A value specifying whether to enable Codabar. *TRUE FALSE length1 Length qualification *4 (0 ~ 55) length2 Length qualification *55 (0 ~ 55) Enable_State clsiEditing A value specifying whether to edit CLSI. TRUE *FALSE Enable_State...
  • Page 52: Code39 Class

    Android Programming Guide Enable_State transmitCheckDigit A value specifying whether to transmit check digit. TRUE *FALSE 1.5.5. CODE39 CLASS public class Code39 public Enable_State enable; public Enable_State checkDigitVerification; public Enable_State transmitCheckDigit; public Enable_State fullASCII; public Enable_State convertToCode32; public Enable_State convertToCode32Prefix; public int length1; public int length2;...
  • Page 53: Triopticcode39 Class

    Chapter 1 Barcode Reader API TRUE *FALSE length1 Length qualification *4 (0 ~ 55) length2 Length qualification *55 (0 ~ 55) 1.5.6. TRIOPTICCODE39 CLASS public class TriopticCode39 public Enable_State enable; Data Type Member Name Description Enable_State enable A value that specifies whether to enable TripoticCode39. TRUE *FALSE 1.5.7.
  • Page 54: Code128 Class

    Android Programming Guide *TRUE FALSE length1 Length qualification *4 (0 ~ 55) length2 Length qualification *55 (0 ~ 55) 1.5.9. CODE128 CLASS public class Code128 public Code128SecurityLevel securitylevel; public Enable_State enable; public int length1; public int length2; Data Type Member Name Description Code128SecurityLevel securitylevel...
  • Page 55: Gs1128 Class

    Chapter 1 Barcode Reader API 1.5.10. GS1128 CLASS public class GS1128 public Enable_State enable; public String fieldSeparator; public Enable_State enableApplicationIdentifier; // Default is disable public String applicationIdentifierMark1; public String applicationIdentifierMark2; Data Type Member Name Description Enable_State enable A value that specifies whether to enable GS1 128. *TRUE FALSE String...
  • Page 56: Chinese2Of5 Class

    Android Programming Guide Enable *Auto concatenationRedundancy A value that specifies concatenation redundancy (2~20 times) when auto-discriminate of ISBT concatenation is enabled. By default, it is set to 10 times. 1.5.12. CHINESE2OF5 CLASS public class Chinese2Of5 public Enable_State enable; Data Type Member Name Description Enable_State...
  • Page 57: Interleaved2Of5 Class

    Chapter 1 Barcode Reader API 1.5.14. INTERLEAVED2OF5 CLASS public class Interleaved 25 public Enable_State enable; public int length1; public int length2; public I20f5CheckDigitVerification checkDigitVerification; public Enable_State transmitCheckDigit; public Enable_State convertToEan13; public SecurityLevel securityLevel; Data Type Member Name Description Enable_State enable A value that specifies whether to enable Interleaved 25.
  • Page 58: Matrix2Of5 Class

    Android Programming Guide Three 1.5.15. MATRIX2OF5 CLASS public class Matrix 25 public Enable_State enable; public int length1; public int length2; public Enable_State redundancy; public Enable_State checkDigitVerification; public Enable_State transmitCheckDigit; Data Type Member Name Description Enable_State enable A value that specifies whether to enable Matrix 25. *TRUE FALSE length1...
  • Page 59: Ucccoupon Class

    Chapter 1 Barcode Reader API 1.5.16. UCCCOUPON CLASS public class UccCoupon public Enable_State enable; Data Type Member Name Description Enable_State enable A value that specifies whether to enable UCC Coupon. TRUE *FALSE 1.5.17. GS1DATABAR14 CLASS public class GS1DataBar14 public int securityLevel; public Enable_State enable;...
  • Page 60: Gs1Databarlimited Class

    Android Programming Guide 1.5.18. GS1DATABARLIMITED CLASS public class GS1DataBarLimited public int securityLevel; public Enable_State enable; public Enable_State convertToUpcEan; Data Type Member Name Description securityLevel A value that specifies the decode security level while reading GS1 DataBar Limited. *3 (1 ~ 4) Enable_State enable A value that specifies whether to enable GS1 DataBar...
  • Page 61: Msi Class

    Chapter 1 Barcode Reader API String fieldSeparator A value that specifies whether to apply a field separator of ASCII ranging from 0 to 127. It’s set to zero by default. Note: The securityLevel elements included in GS1DataBar14 and GS1dataBarExpanded symbologies correspond to each other; changing either of the element value of a particular symbology will also change the other one.
  • Page 62: Ean8 Class

    Android Programming Guide 1.5.21. EAN8 CLASS public class Ean8 public Enable_State enable; public AddonsType addon2; public AddonsType addon5; public Enable_State transmitCheckDigit; public Enable_State convertToEan13; Data Type Member Name Description Enable_State enable A value that specifies whether to enable EAN-8. *TRUE FALSE AddonsType addon2...
  • Page 63: Ean13 Class

    Chapter 1 Barcode Reader API 1.5.22. EAN13 CLASS public class Ean13 public Enable_State enable; public AddonsType addon2; public AddonsType addon5; public Enable_State convertToISBN; public Enable_State convertToISSN; public ISBNFormat booklandISBNFormat; public Enable_State transmitCheckDigit; Data Type Member Name Description Enable_State enable A value that specifies whether to enable EAN-13. *TRUE FALSE AddonsType...
  • Page 64: Upca Class

    Android Programming Guide Note: The addon2, addon5, and transmitCheckDigit elements included in Ean8 and Ean13 symbologies correspond to each other respectively; changing either of the element value of a particular symbology will also change the other one. 1.5.23. UPCA CLASS public class Upca public Enable_State enable;...
  • Page 65: Upce Class

    Chapter 1 Barcode Reader API 1.5.24. UPCE CLASS public class Upce public Enable_State enable; public AddonsType addon2; public AddonsType addon5; public Enable_State transmitCheckDigit; public Preamble transmitSystemNumber; public Enable_State convertToUpcA; Data Type Member Name Description Enable_State enable A value that specifies whether to enable UPC-E. *TRUE FALSE AddonsType...
  • Page 66: Upce1 Class

    Android Programming Guide 1.5.25. UPCE1 CLASS public class UpcE1 public Enable_State enable; public AddonsType addon2; public AddonsType addon5; public Enable_State transmitCheckDigit; public Preamble transmitSystemNumber; public Enable_State convertToUpcA; Data Type Member Name Description Enable_State enable A value that specifies whether to enable UPC-E1. *TRUE FALSE AddonsType...
  • Page 67: Composite Class

    Chapter 1 Barcode Reader API 1.5.26. COMPOSITE CLASS public class Composite public Enable_State enableCc_C; public Enable_State enableCc_AB; public Enable_State enableTlc39; public UpcMode enableUpcMode; public Enable_State enableEmulationMode; Data Type Member Name Description Enable_State enableCc_C A value that specifies whether to enable Composite CC-C. *TRUE FALSE Enable_State...
  • Page 68: Uspostal Class

    Android Programming Guide 1.5.27. USPOSTAL CLASS public class USPostal public Enable_State enablePlanet; public Enable_State enablePostnet; public Enable_State transmitCheckDigit; Data Type Member Name Description Enable_State enablePlanet A value that specifies whether to enable US Planet. *TRUE FALSE Enable_State enablePostnet A value that specifies whether to enable US Postnet. *TRUE FALSE Enable_State...
  • Page 69: Japanpostal Class

    Chapter 1 Barcode Reader API 1.5.29. JAPANPOSTAL CLASS public class JapanPostal public Enable_State enable; Data Type Member Name Description Enable_State enable A value that specifies whether to enable Japan Postal. *TRUE FALSE 1.5.30. AUSTRALIANPOSTAL CLASS public class AustralianPostal public Enable_State enable; Data Type Member Name Description...
  • Page 70: Uspspostal Class

    Android Programming Guide 1.5.32. USPSPOSTAL CLASS public class USPSPostal public Enable_State enable; Data Type Member Name Description Enable_State enable A value that specifies whether to enable USPS Postal. *TRUE FALSE 1.5.33. UPUFICSPOSTAL CLASS public class UPUFICSPostal public Enable_State enable; Data Type Member Name Description Enable_State...
  • Page 71: Micropdf417 Class

    Chapter 1 Barcode Reader API *PassthroughAllSymbols Enable_State escapeCharacter A value that specifies whether to use the escape character. TRUE *FALSE Enable_State transmitControlHeader A value that specifies whether to transmit the control header. TRUE *FALSE 1.5.35. MICROPDF417 CLASS public class MicroPDF417 public Enable_State enable;...
  • Page 72: Maxicode Class

    Android Programming Guide MatrixMirrorImage mirrorImage A value that specifies whether to decode mirror image Data Matrix barcodes. *Never Always Auto 1.5.37. MAXICODE CLASS public class MaxiCode public Enable_State enable; Data Type Member Name Description Enable_State enable A value that specifies whether to enable Maxicode. *TRUE FALSE 1.5.38.
  • Page 73: Aztec Class

    Chapter 1 Barcode Reader API 1.5.40. AZTEC CLASS public class Aztec public Enable_State enable; Data Type Member Name Description Enable_State enable A value that specifies whether to enable Aztec. *TRUE FALSE 1.5.41. TELEPEN CLASS public class Telepen public Enable_State enable; public TelepenFormat format;...
  • Page 74: Plessey Class

    Android Programming Guide 1.5.42. PLESSEY CLASS public class Plessey public Enable_State enable; public Enable_State unconventionalStop; public Enable_State transmitCheckDigit; public int length1; public int length2; Data Type Member Name Description Enable_State enable A value that specifies whether to enable Plessey. *TRUE FALSE Enable_State State unconventionalStop...
  • Page 75: Reset Reader

    Chapter 1 Barcode Reader API 1.6. RESET READER ResetReaderToDefault Purpose Resets reader module(s). Syntax ClResult ResetReaderToDefault () Example if (ClResult.S_ERR == mReaderManager.ResetReaderToDefault()) Toast.makeText(this, "ResetReaderToDefault was failed", Toast.LENGTH_SHORT).show(); else { Toast.makeText(this, "ResetReaderToDefault was done!", Toast.LENGTH_SHORT).show(); Return Value If successful, it returns ClResult.S_OK. Otherwise, it returns ClResult.S_ERR.
  • Page 76: Intent

    Android Programming Guide 1.7. INTENT 1.7.1. READER SERVICE CONNECTION GeneralString.Intent_READERSERVICE_CONNECTED Purpose After running InitInstance, the system makes connection between the application and the reader service. With success in making connection, this intent is sent. 1.7.2. SOFTWARE TRIGGER GeneralString.Intent_SOFTTRIGGER_DATA Purpose By calling SoftScanTrigger() to scan the barcode with success, this intent is used to inform the application.
  • Page 77: Decoding Error

    Chapter 1 Barcode Reader API 1.7.4. DECODING ERROR GeneralString.Intent_DECODE_ERROR Purpose If an error occurs in decoding the barcode, this intent is used to inform the application. Parameters GeneralString.BcReaderDecode Only for Codabar check digit verification. Error (DecodeErrorType.ERROR_Codabar_Ver ify_Check_Digit) Syntax getIntExtra(GeneralString.BcReaderDecodeError) 1.7.5. DATA SENDING The table below depicts the data sent by intents or Keyboard Emulator depending on the conditions.
  • Page 78: Callback

    Android Programming Guide 1.8. CALLBACK When the callback function is enabled, the intent is then disabled. 1.8.1. SETREADERCALLBACK SetReaderCallback Purpose Set the reader callback function. void SetReaderCallback(ReaderCallback readerCallback); Syntax Example interface ReaderCallback void onDecodeComplete(in String strDecodeData); See Also GetReaderCallbackStatus 1.8.2. GETREADERCALLBACK GetReaderCallbackStatus Purpose Verify whether the callback function is enabled.
  • Page 79 Chapter 1 Barcode Reader API filter.addAction(GeneralString.Intent_READERSERVICE_CONNECTED); registerReceiver(myDataReceiver, filter); /// create a BroadcastReceiver for receiving intents from barcode reader service private final BroadcastReceiver myDataReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction().equals(GeneralString.Intent_READERSERVICE_CONNECTED)){ // Make sure this app bind to barcode reader service , then user can use APIs // to get/set settings from barcode reader service BcReaderType myReaderType = mReaderManager.GetReaderType();...
  • Page 80 Android Programming Guide...
  • Page 81: Sam Api

    Chapter 2 SAM API Because Google hasn’t defined the class relating to SAM, this object provides the SAM Controller access method for the application. Before developing your self-made application, the offered “SamAPI.jar” library file has to be imported into your project. Please refer to 1.1 Import Library on how to import the library.
  • Page 82: Bind Sam Service

    Android Programming Guide 2.1 BIND SAM SERVICE SamManager InitInstance(Context context) Purpose Binds SAM service. Parameters context is Activity Example private SamManager m_SM; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); m_SM = SamManager.InitInstance(this); Return Value Gets a SamManager instance if successful, else null. ClResult ExecuteApdu(int[] cmd, ApduOutputData outputData, int timeOut) Purpose Sends APDU command and get response of IC card.
  • Page 83: Service Information

    Chapter 2 SAM API Example @Override protected void onDestroy() { super.onDestroy(); m_SM.Release(); See Also SamManager InitInstance ClResult Reset Purpose Reset SAM controller. Syntax ClResult Reset() Return Value If successful, it returns ClResult.S_OK. Otherwise, it returns ClResult.S_ERR. 2.2 SERVICE INFORMATION Get_SamServiceVer Purpose Gets SAM service version of the device.
  • Page 84 Android Programming Guide...
  • Page 85: Os Update

    Chapter 3 OS Update Chapter 3 OS UPDATE OS update (including upgrade and downgrade) will supply Intent for users to install upgrade/downgrade package on both internal storage and external SD card. Upgrade/downgrade Package File Data_SDPath Internal storage /storage/sdcard0/ SD card /storage/sdcard1/ Notes: OS Update is now only available for RS31.
  • Page 86: Os Update Intent

    Android Programming Guide 3.1 OS UPDATE INTENT 3.1.1. OS UPDATE ARCHITECTURE The diagram below depicts the OS Update for RS31. OS Update function diagram...
  • Page 87: Launch Os Update With Intent

    Chapter 3 OS Update 3.1.2. LAUNCH OS UPDATE WITH INTENT Purpose Launch the OS update with intent. Intent Action com.cipherlab.OtaUpdateService.SD Intent Name com.cipherlab.otaupdate.OtaUpdateService Intent Parameters Data_SDPath Example Intent SDIntent = new Intent(); SDIntent.setClassName("com.cipherlab.otaupdate","com.cipherlab.otau pdate.OtaUpdateService"); SDIntent.setAction("com.cipherlab.OtaUpdateService.SD"); Bundle bundle = new Bundle();...
  • Page 88: Get Error Message With Broadcast

    Android Programming Guide 3.1.3. GET ERROR MESSAGE WITH BROADCAST Purpose If an error occurs during OS update, this intent is used to inform the application. Intent Action com.cipherlab.OtaUpdateService.ErrorMessage Intent Parameters Data_ErrorMessage Intent Return Error Message Description Value Integer Value ERROR_UNZIP...
  • Page 89: Os Update Result

    Chapter 3 OS Update 3.1.4. OS UPDATE RESULT After upgrade, the device restarts into normal mode in new system version. And then a dialog displays after the phone boots up to indicate the upgrade result.
  • Page 90: Sample Code

    { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // ***************************************************// // Create an IntentFilter to get intents which we want // Register an IntentFilter // Add "com.cipherlab.OtaUpdateService.ErrorMessage" for fetching the error message // ***************************************************// IntentFilter filter_return = new IntentFilter(); filter_return.addAction("com.cipherlab.OtaUpdateService.ErrorMessage"); registerReceiver(myReceiver_return, filter_return);...
  • Page 91 // call OS Update sample code SD_Update(); // Here is the launch OS Update with intent examples public void SD_Update() Intent SDIntent = new Intent(); SDIntent.setClassName("com.cipherlab.otaupdate","com.cipherlab.otaupdate.Ota UpdateService"); //Set the SD action to be performed. SDIntent.setAction("com.cipherlab.OtaUpdateService.SD"); Bundle bundle = new Bundle();...
  • Page 92 Android Programming Guide // Fetch the error message along with the intent. Bundle GetErrorbundle = intent.getExtras(); int value = GetErrorbundle.getInt("Data_ErrorMessage"); ErrorValue = "ErrorMessage = " + value + "\n"; TextViewVaule.setText(ErrorValue); @Override public void onDestroy() // ***************************************************// // Unregister Broadcast Receiver before app close // ***************************************************// unregisterReceiver(myReceiver_return);...
  • Page 93: Response Code Instructions

    Appendix I RESPONSE CODE INSTRUCTIONS Value Instruction ClResult.S_OK Successful completion of request ClResult.S_ERR Unknown error ClResult.ERR_NotSupport Symbology not supported ClResult.ERR_InvalidParameter Invalid parameter...
  • Page 94 Android Programming Guide...
  • Page 95: Scan Engine Settings

    Appendix II SCAN ENGINE SETTINGS The mobile computer is equipped with a barcode reader as follows. Reader availability depends on the hardware integrated on the mobile computer. Scan Engine SE965 SE965E SE965I Laser SE955 Extended Range Laser (ER Laser) SE1524 SE4500 2D Imager SE4750SR...
  • Page 96: Symbologies Supported

    Android Programming Guide SYMBOLOGIES SUPPORTED Depending on the scan engine integrated on the mobile computer, supported symbologies will differ as listed below. SE955, SE965, SE4500, SE965E, SE4750SR, SE965I SE4750MR EX25 SE1524 Codabar      Code 11  ...
  • Page 97 Scan Engine Settings GS1 DataBar Expanded      (RSS Expanded) Convert to UPC/EAN    Korean 3 of 5       Postal Codes Australian Postal   Japan Postal   Netherlands KIX Code ...
  • Page 98: Configurable Symbology Properties

    Android Programming Guide Han Xin CONFIGURABLE SYMBOLOGY PROPERTIES Depending on the scan engine integrated on the mobile computer, configurable symbology properties will differ as listed below. SE955, SE965, SE4500, SE965E, SE4750SR, Symbologies Properties SE965I SE4750MR EX25 SE1524 General Properties transmitCheckDigit ...
  • Page 99 Scan Engine Settings length1           length2      enable GS1128      fieldSeparator enable        ISBT128 concatenation  concatenationRedundancy Chinese2Of5 ...
  • Page 100 Android Programming Guide length1           length2      checkDigitOption      transmitCheckDigit checkDigitAlgorithm          enable   ...
  • Page 101 Scan Engine Settings enableCc_AB    enableTlc39  enableUpcMode  enableEmulationMode enablePlanet     USPostal enablePostnet   transmitCheckDigit enable  UKPostal  transmitCheckDigit JapanPostal   enable AustralianPostal   enable DutchPostal enable    USPSPostal enable UPUFICSPostal...
  • Page 102 Android Programming Guide length2  SE955, SE965, SE4500, SE965E, SE4750SR, Symbologies Properties SE965I SE4750MR EX25 SE1524 User Preferences     addonSecurityLevel displayMode      laserOnTime  negativeBarcodes  pickListMode redundancyLevel     scanAngle ...
  • Page 103: Code Type & Symbology

    Code Type & Symbology Appendix III CODE TYPE & SYMBOLOGY The table below lists symbologies and the corresponding code types. ASCII Symbology 0x2F 47 (/) Composite CC-A 0x37 55 (7) Composite CC-B 0x38 56 (8) Korean 3 of 5 0x39 57 (9) ISSN 0x3F...
  • Page 104 Android Programming Guide 0x59 89 (Y) Undefined 0x5A 90 (Z) Telepen 0x5B 91 ( [ ) GS1 DataBar Omnidirectional (RSS-14) 0x5C 92 (\) GS1 DataBar Limited (RSS Limited) 0x5D 93 ( ] ) GS1 DataBar Expanded (RSS Expanded) 0x5E 94 (^) UPC-A 0x5F 95 (_)
  • Page 105 Code Type & Symbology 0x7D 125 (}) UPU FICS Postal 0x7E 126 (~) Macro MicroPDF417...
  • Page 106 Android Programming Guide...
  • Page 107: Adc Profile Deployment

    ADC Profile Deployment Appendix IV ADC PROFILE DEPLOYMENT Users can develop their own applications to perform ADC profile deployment tasks on the Android device. Please copy beforehand the ADC profiles located in the ADC project directory to the Android device’s directories respectively. GENERAL DEPLOYMENT ADC profiles listed in the table below have to be copied to the target directory.
  • Page 108: Deployment For File Transfer

    Android Programming Guide DEPLOYMENT FOR FILE TRANSFER For the File Transfer deployment task, please open and edit the FileTransfer.json file where you can specify the local file directory on your PC. For example, the picture below illuminates that the “FileTransfer_%.txt” file located on your PC will be copied to “/storage/emulated/0/ADC/File/”...
  • Page 109: Deployment For System Settings

    ADC Profile Deployment DEPLOYMENT FOR SYSTEM SETTINGS For the System Settings deployment task, please open and edit the FileTransfer.json file where you can specify the local file directory on your PC. For example, the picture below illuminates that the “background-01.jpg” file located on your PC will be copied to “/storage/emulated/0/ADC/File/”...
  • Page 110: Setting Adc

    Android Programming Guide SETTING ADC After the file is copied, there are two ways to send the deployment intent to set the ADC. Using ADB to send broadcast adb shell am broadcast -a "sw.programme.adcclient.SetSettingAll" adb shell am broadcast -a "sw.programme.adcclient.SystemSettings" Source code Intent intent = new Intent("sw.programme.adcclient.SetSettingAll");...
  • Page 111: Sample Code

    Appendix V SAMPLE CODE package com.example.cipherlab; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.widget.TextView; public class MainActivity extends Activity { private TextView tv1 = null; private IntentFilter filter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);...
  • Page 112 Android Programming Guide...
  • Page 113: Open Source License

    Open Source License Appendix VI OPEN SOURCE LICENSE The Reader/SAM API involves the android-serialport-api project of Apache License Version 2.0, January 2004. http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
  • Page 114 Android Programming Guide "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
  • Page 115 Open Source License c. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; d.
  • Page 116 Android Programming Guide 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure...

Table of Contents