SmartPosAndroidSDK English V1.2.3 190411
SmartPosAndroidSDK English V1.2.3 190411
1
Version number Date Xiugaizhe Explain
V1.01 _ B 20180601 2018-05-21 Xiaonana SDK generation
2018-06-15 Xiaonana M1 authentication, read
card, add card
2018-06-19 Xiaonana The return and listening of
the card data query method
is joined by a onNoCard
method to determine
whether the IC card is still
in the card slot or the card
area.
2018-06-23 Xiaonana RF card reset method.
Offline pin input method
Password keyboard settings
hide their own input box.
And setting the customized
edittext
V1.1.0_B20180717 2018-07-17 yyzz Mpos sdk integration
V1.1.1_B20180725 2018-07-25 yyzz 1. Add transparent mode
2. Mpos firmware
upgrade, unlock
interface added
V1.1.2_R20180730 2018-07-30 yyzz Add fingerprint input
interface
V1.1.3_R20180731 2018-07-31 yyzz Set system time, silent
installation and
uninstallation
V1.1.4_R20180810 2018-08-10 yyzz Get card hoder, exp, seq for
Mpos
V1.1.5_R20180818 2018-08-18 yyzz Mpos get tlv
V1.1.6_R180907 2018-09-07 yyzz 1. Silent installation and
silent uninstallation with
return value
2. Interface adjustment
V1.1.7_R181017 2018-10-17 yyzz Improve print speed
V1.1.8_R181102 2018-11-02 yyzz Add Mpos interface
V1.1.9_R181116 2018-11-16 yyzz Add SLE4442 feature
V1.2.0_R181126 2018-11-26 yyzz Add fingerprint feature
V1.2.1_R181129 2018-11-29 yyzz Add SLE4428 feature
2
V1.2.2_R190318 2019-03-18 yyzz DUKPT
V1.2.3_R190411 2019-04-11 yyzz 1. API adjustment
2.Mpos Bluetooth bug fix
1 Brief introduction.............................................................................................................................................................7
1.1 Demo................................................................................................................................................................. 8
1.2 Term................................................................................................................................................................... 8
3 Class method..................................................................................................................................................................11
3
3.2.8 Get the firmware version number...................................................................................................................15
3.2.9 Get the customer serial number......................................................................................................................15
3.2.10 Get terminal model..........................................................................................................................................16
3.2.11 Power on the system.......................................................................................................................................17
3.2.12 System down...................................................................................................................................................17
3.2.13 Setting the system time...................................................................................................................................17
3.2.14 Silently installing the specified application......................................................................................................18
3.2.15 Silently uninstall the specified application.......................................................................................................18
3.2.16 Setting the External Serial Port........................................................................................................................19
3.2.17 Send transparent data.....................................................................................................................................19
3.2.18 Receiving transparent data..............................................................................................................................20
3.2.19 Device Unlock Request (for internal use only).................................................................................................20
3.2.20 Device Unlocking (for internal use only)..........................................................................................................21
3.2.21 Firmware update.............................................................................................................................................21
3.3 Bluetooth management class (for Mpos).........................................................................................................22
3.3.1 Initialize............................................................................................................................................................22
3.3.2 Set up Bluetooth connection monitoring.........................................................................................................22
3.3.3 Search for Bluetooth........................................................................................................................................23
3.3.4 Cancel search for Bluetooth.............................................................................................................................23
3.3.5 Connect to Bluetooth.......................................................................................................................................24
3.3.6 Disconnect Bluetooth......................................................................................................................................24
3.3.7 Get Bluetooth connection status.....................................................................................................................24
3.3.8 Set timeout......................................................................................................................................................25
3.4 BluetoothHandler(For Mpos)...........................................................................................................................25
3.4.1 Add Emv callback listener................................................................................................................................25
3.4.2 Search card......................................................................................................................................................26
3.4.3 Cancel card search...........................................................................................................................................26
3.4.4 Specify the amount to execute Emv................................................................................................................26
3.4.5 Get 55 domain data.........................................................................................................................................27
3.4.6 Get track two data...........................................................................................................................................27
3.4.7 Get the card number........................................................................................................................................28
3.4.8 Get the card holder..........................................................................................................................................28
3.4.9 Get expire date................................................................................................................................................28
4
3.4.10 Get IC sequence number.................................................................................................................................29
3.4.11 Get TLV............................................................................................................................................................29
3.4.12 Display main screen (for Mpos).......................................................................................................................30
3.4.13 Screen display amount (for Mpos)...................................................................................................................30
3.4.14 Update system time (for Mpos).......................................................................................................................30
3.4.15 The screen displays the QR code and amount.................................................................................................31
3.5 Led class...........................................................................................................................................................31
3.5.1 Led................................................................................................................................................................... 32
3.6.1 beeper..............................................................................................................................................................33
3.6.2 The beeper specifies the frequency to sound..................................................................................................33
3.7 Reading card module.......................................................................................................................................34
3.7.1 CardReaderManager class...............................................................................................................................34
3.7.2 ICCard class......................................................................................................................................................37
3.7.3 MagCard class..................................................................................................................................................40
3.7.4 RFCard class.....................................................................................................................................................43
3.7.5 SLE4442Card class............................................................................................................................................48
3.7.6 SLE4428Card class............................................................................................................................................52
3.8 Print module....................................................................................................................................................56
3.8.1 Get the printing state.......................................................................................................................................57
3.8.2 Set the printing speed level.............................................................................................................................57
3.8.3 Append character data....................................................................................................................................58
3.8.4 Append QRcode...............................................................................................................................................59
3.8.5 Append barsCsode...........................................................................................................................................59
3.8.6 Append picture................................................................................................................................................60
3.8.7 Start printing....................................................................................................................................................61
3.9 Pin module.......................................................................................................................................................61
3.9.1 Get the random number..................................................................................................................................61
3.9.2 Set the encryption algorithm type...................................................................................................................62
3.9.3 Update master key...........................................................................................................................................62
3.9.4 Encrypted update master key..........................................................................................................................63
3.9.5 Update the work key........................................................................................................................................64
3.9.6 Update the encryption key in the work key.....................................................................................................64
5
3.9.7 Track data encryption......................................................................................................................................65
3.9.8 Computing mac................................................................................................................................................66
3.9.9 Download DUKPT in plain text.........................................................................................................................67
3.9.10 Calculate mac using DUKPT key.......................................................................................................................67
3.9.11 Encrypt data using the DUKPT key...................................................................................................................68
3.9.12 Set the prompt information that pin entered..................................................................................................69
3.9.13 Enter online PIN...............................................................................................................................................69
3.9.14 Hardware serial number key encryption..........................................................................................................70
3.9.15 Enter offline PIN...............................................................................................................................................71
3.9.16 Set password whether the input box is hidden................................................................................................72
3.9.17 Set edittext to use the password keyboard (after the password entry box is hidden).....................................72
3.10 Fingerprint module..........................................................................................................................................73
3.8.1 Initialize............................................................................................................................................................73
3.8.1 Close................................................................................................................................................................73
3.8.1 Capture............................................................................................................................................................74
3.8.1 Capture feature................................................................................................................................................74
3.8.1 Capture ISO feature.........................................................................................................................................75
3.8.1 Enrollment.......................................................................................................................................................75
3.8.1 Authenticate....................................................................................................................................................76
3.8.1 Authenticate....................................................................................................................................................76
3.8.1 Remove fingerprint..........................................................................................................................................77
3.8.1 Remove all.......................................................................................................................................................77
3.8.1 Get enrolled fingerprint count.........................................................................................................................77
3.8.1 Get the list of enrolled fingerprint id...............................................................................................................78
3.8.2 Generate a Bitmap and store it to the specified path......................................................................................78
3.8.3 Add listener......................................................................................................................................................79
3.8.4 Remove listener...............................................................................................................................................79
3.11 External card slot module (for exclusive external card slot)............................................................................80
3.11.1 ExternalCardManager 类.................................................................................................................................80
3.11.2 IC card..............................................................................................................................................................81
3.12 Serial port module (not available)....................................................................................................................84
3.13 String tools class..............................................................................................................................................84
3.13.1 Converts a 16 th string into an array of byte....................................................................................................84
6
3.13.2 Convert an array of byte into a 16 th string.....................................................................................................84
3.13.3 A string that converts an ASCII string into a 16 th decimal string....................................................................85
3.13.4 Convert a 16 th binary string to an ASCII string...............................................................................................85
3.13.5 Convert GBK bytes into strings........................................................................................................................85
3.13.6 Turn string into GBK bytes...............................................................................................................................86
3.13.7 Convert int into four bytes in large terminal mode byte []..............................................................................86
3.13.8 Convert int into two bytes in large terminal mode byte []...............................................................................86
3.13.9 Convert int into four bytes in small terminal mode byte []..............................................................................87
3.13.10 Convert four bytes of byte [] into int in large terminal mode...................................................................87
3.13.11 Converts four bytes of byte [] into int in small terminal mode.................................................................87
3.13.12 Get subarrays...........................................................................................................................................88
3.13.13 Combine two numbers into an array........................................................................................................88
3.13.14 To merge part of the data of two arrays into an array.............................................................................88
3.13.15 Converts an array of 16-step byte into a 16-step string...........................................................................89
3.14 Callback interface.............................................................................................................................................89
3.14.1 OnSearchCardListener.....................................................................................................................................89
3.14.2 OnPinPadInputListener....................................................................................................................................90
3.14.3 BluetoothListener(for Mpos)...........................................................................................................................90
3.14.4 OnBluetoothEmvListener(For Mpos)...............................................................................................................91
3.14.5 UpdateListener................................................................................................................................................91
3.14.6 FingerprintListener..........................................................................................................................................92
3.15 Returns code information................................................................................................................................93
7
1 Brief introduction
This document helps developers to develop third-party applications on the z90 equipment of the smart pos machine.Our
company provides the jar package for the API interface.
The developer based on the API interface, convenient and efficient development of third-party applications to meet
developers personalized needs.
1.1 Demo
The demo file demonstrates how to use the jar packet to call the various interfaces of the api to meet the needs of
the application.
1.2 Term
ResultData Clasee is data returns the value class, in which the field defines all return values in the document, and all
field descriptions are shown in the appendix.
Hardware: PC
System: windows
Development environment: eclipse
Version of the z90 android operating system: version 5.1.1 is on
8
2 How to create a project?
In order to add the jar package to the developer project, please follow the following steps:
9
1.6 Add configuration and permissions to android manifest.xml
Increase permissions
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera.autofocus"/>
<uses-feature android:name="android.hardware.camera"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/>
To use the EMV feature, the libEmvCoreJni.so file are placed under jnilibs/armebi
10
3 Class method
The DriverManager class is responsible for managing the general class of all the tools classes of the pos.
There are multiple access tools single class methods and system initialization methods.
Start
11
1.2 System module
Mainly is the configuration system foundation information as well as obtains some basic data use class.
Get the objects for debugging the class:
Output parameters
Return SDK_OK Success
Other See this subcompact definition (error
code)
Data structure
Note System initialization (AP and sp authentication), other functions can only be
used if authentication is successful.
12
Method name public int sdkInit( ConnectTypeEnum type);
Output parameters
Return SDK_OK Success
Other See this subcompact definition (error
code)
Data structure
Note Bluetooth connection initialization method for our Mpos products
not display
Output parameters
code)
Data structure
Note
Example
Input parameters
13
Output parameters version This parameter is the value on the
first bit of the obtained version
information.
code)
Data structure
Note
Example
Input parameters
code)
Data structure
Note
Example
Output parameters
14
byte array types.
Data structure
Note
Example
Input parameters
code)
Data structure
Note
Example
Input parameters
15
Return SDK_OK Success
code)
Data structure
Note
Example
Input parameters
code)
Data structure
Example
Describe
Input parameters
16
bit of the obtained firmware version
code)
Data structure
Note
Example
Input parameters
Output parameters
code)
Data structure
Example
Input parameters
Output parameters
17
Other See this subcompact definition (error
code)
Data structure
Example
Describe
Output parameters
code)
Data structure
Note This interface can obtain root rights to modify system time.
Example
Describe
such as /data/media/0/xxx.apk
Output parameters
18
Other See this subcompact definition (error
code)
Note
Example
Describe
com.szzcs.smartpos
Output parameters
code)
Note
Example
Method name public int setExternalPort(byte isOpen, int uiBaut, byte[] PubKeyStatus)
Describe
57600
19
PubKeyStatus
Output parameters
code)
Data structure
Note
Example
Output parameters
code)
Data structure
Note
Example
Describe Get data from the external serial port. When there is no data, the length
returned is 0.
20
data Receive data
Output parameters
code)
Data structure
Note
Example
encrypted data
Output parameters
code)
Data structure
Note
Example
21
encData Encrypted data
Output parameters
code)
Data structure
Note
Example
code)
Data structure
Note
Example
The BluetoothManager class is responsible for Mpos Bluetooth scanning, connecting, disconnecting, and
obtaining connection status.
1.1.1 Initialize
22
Describe Bluetooth initialization, you need to call setContext() and
Input parameters
Output parameters
Return BluetoothManager
Data structure
Note
Example
listener)
Mpos)
Output parameters
Return
Data structure
Note
Example
Input parameters
Output parameters
23
Return
Data structure
Note
Example
Input parameters
Output parameters
Return
Data structure
Note
Example
Output parameters
Return
Data structure
Note
Example
24
Describe Disconnect Bluetooth
Input parameters
Output parameters
Return
Data structure
Note
Example
Input parameters
Output parameters
Return
Data structure
Note
Example
Describe Set the timeout period. Note that the timeout is greater than the
Input parameters
Output parameters
Return
Data structure
Note
25
Example
The BluetoothHandlered class is responsible for obtaining the relevant valid data after Mpos executes Emv.
Describe
OnBluetoothEmvListener(For Mpos)
Output parameters
Return
Data structure
Note
Example
Input parameters
Output parameters
code)
26
Data structure
Note
Example
Input parameters
Output parameters
code)
Data structure
Note
Method name public int emv(CardReaderTypeEnum cardType, int amount, String date,
int timeout)
amount Amount
yyyyMMddHHmmss
Output parameters
code)
27
Data structure
Note
Example
Input parameters
Output parameters
Data structure
Note
Example
Input parameters
Output parameters
Data structure
Note
Example
28
Input parameters
Output parameters
Data structure
Note
Example
Input parameters
Output parameters
Data structure
Example
Input parameters
Output parameters
Data structure
Example
29
1.1.18Get IC sequence number
Input parameters
Output parameters
Data structure
Example
1.1.19Get TLV
Output parameters
null
Data structure
Note
Example
Input parameters
Output parameters
30
Return SDK_OK Success
code)
Data structure
Note
Example
Input parameters
Output parameters
code)
Data structure
Note
Example
Output parameters
code)
Data structure
Note
31
Example
Output parameters
code)
Data structure
Note
Example
The led class is responsible for managing the lights on and off of the led lights of the poos.
Start
32
Call the set method to operate
the pos Led light switch
1.1.1 Led
headlight
Output parameters
code)
Example
33
Beeper beep = manager.getBeeper();
Start
3.2.1 beeper
Describe The drive buzzer keeps ringing for a long time, and the default
buzzer is 3000.
Input parameters beepTime Timeout length, unit milliseconds
Output parameters
Return SDK_OK Success
SDK_ERROR Fail
Data structure
Note
34
3.2.2 The beeper specifies the frequency to sound.
These include several categories: the CardReaderManager, the ICCard, the RFCard and the MagCard.
The function of the CardReaderManager class is mainly to deal with the reading card of three kinds of cards and to
obtain the object of three kinds of cards.
Get the object of the CardReaderManager class:
35
1.1.1.1 SearchCard method
Describe Open the corresponding card reader and check whether the
when 0
query card.
code)
36
RF_CARD,
/* *
* features of magnetic and IC card queries
*/
MAG_IC_CARD,
/* *
* functions with magnetic and non-access card queries
*/
MAG_RF_CARD,
/* *
* features of IC and non-access card queries
*/
IC_RF_CARD,
/* *
* features of magnetic and IC cards and non-access card queries
*/
Mag _ IC_ RF _ card
Note
Example
Input parameters
Output parameters
Return
Data structure
Note
Example
37
Describe Close all card slots.
Input parameters
Output parameters
Return SDK_OK Success
code)
Data structure
Note
Example
The ICCardclass is basically the operation of data interaction on IC card, and the information of IC card reader is
encapsulated and implemented in the cardReaderManager, In the callback information for processing IC card data,
such as interaction operations.
receiveAtr,int[] receiveLength)
code)
38
Data structure CardSlotNoEnum
SDK_ICC_USERCARD
SDK_ICC_SAM1
SDK_ICC_SAM2
Note
Example
Output parameters
Return SDK_OK Success
code)
Data structure
Note
Example
Output parameters
code)
Data structure
39
Note
Example
0x02: 5V
115200
code)
Data structure
Note
Example
40
Output parameters receiveDataLength Response length
code)
Data structure
Note
Example
send Data )
Output parameters
Return byte [] Receive data information, return data
error.
Data structure
Note
Example
The MagCard class is basically something to do with the data interaction of the MagCard.
41
1.1.1.1 Open the MagCard device.
Input parameters
Output parameters
code)
Data structure
Note Call this method to open the bar device once and you cannot call this
function again.
This function can be called before the query card is called, and can not
be called after the query card (the method of opening the magnetic
card device has been called when the query card is called.
Example
Input parameters
Output parameters
code)
Data structure
Note After the card operation is completed, the release method should be
42
Example
Input parameters
Output parameters
code)
Data structure
Note This method needs to clear the information of the magnetic card device
Example
Describe Obtain the information of the magnetic channel and decrypt the card
Input parameters
measurement.
code)
Data structure
43
Example
Describe Obtain the information of the magnetic channel and decrypt the
code)
Data structure
Note
Example
The rfcard class is basically something that interacts data on the rfcard.
1.1.1.6 powerDown
44
Input parameters
Output parameters
Return SDK_OK Success
Other See this subcompact definition
(error code)
Data structure
Note This method is the power-down function of the RFcard module.
Example
Example
45
Return SDK_OK Success
Other See this subcompact definition
(error code)
Data structure
Note
Example
information.
information length.
code)
Data structure
Note
Example
Method name public int rfExchangeAPDU(byte[] send Data, byte[] receiveData, int[]
reveiceLength)
46
Output parameters receiveData Output parameter length 300.
code)
Data structure
Note Adpu interaction is a RFcards way of communicating data.
Example
Output parameters
Return byte [] Receive data information, return data
error.
Data structure
Note Adpu interaction is a RFcardss way of communicating data.
Example
47
KeyType Authentication types 0x00typea and
0x01 typeb
6 bytes)
Output parameters
Return SDK_OK Success
code)
Data structure
Note
Example
code)
Data structure
Note
Example
48
1.1.1.14 M1 card writing card
Output parameters
Return SDK_OK Success
Other See this subcompact definition (error
code)
Data structure
Note When writing a card, the default does not write the fourth block of
each sector, and the fourth block may store the authentication
Example
The SLE4442Card class is basically something to do with the data interaction of the SLE4442 Card.
1.1.1.15 Init
49
Describe Init SLE4442 card
Input parameters
Output parameters
code)
Data structure
Example
Input parameters
Output parameters
code)
Data structure
Example
Method name public int readData(byte startAddr, byte readLen, byte[] outData)
50
Output parameters outData Read data
code)
Data structure
Note
Example
Method name public int writeData(byte startAddr, byte writeLen, byte[] inData)
Output parameters
code)
SDK_SLE4442_WRITE_ERR: write
card error
Data structure
Note
Example
51
Input parameters
code)
Data structure
Example
inData)
inData Data
Output parameters
code)
SDK_SLE4442_ADDR_DATA_DIFF_ERR:
is different
Data structure
Note
Example
52
1.1.1.21 Change key
Input parameters
Output parameters
code)
SDK_SLE4442_CHANGE_KEY_ERR:
Data structure
Note
Example
Input parameters
password is verified.
code)
Data structure
53
Note
Example
The SLE4428Card class is basically something to do with the data interaction of the SLE4428 Card.
1.1.1.23 Init
Input parameters
Output parameters
code)
Data structure
Example
Input parameters
Output parameters
54
Return SDK_OK Success
code)
Data structure
Example
Method name public int readData(int startAddr, int readLen, byte[] outData)
code)
Data structure
Note
Example
Method name public int writeData(int startAddr, int writeLen, byte[] inData)
Output parameters
55
Return SDK_OK Success
code)
SDK_SLE4428_WRITE_ERR: write
card error
Data structure
Note
Example
Method name public int readProtectedData(int startAddr, int readLen, byte[] outData)
code)
Data structure
Example
Method name public int writeProtectedData(int startAddr, int writeLen, byte[] inData)
56
inData Data
Output parameters
code)
SDK_SLE4428_WRITE_PRO_ERR: write
error
Data structure
Note
Example
Input parameters
Output parameters
code)
SDK_SLE4428_CHANGE_KEY_ERR:
Data structure
Note
Example
57
Describe Read the count of erifying key and the key
Input parameters
code)
Data structure
parseErrorCount(byte count)
Example
Input parameters
Output parameters
code)
Data structure
58
Note Call the printing state before setting the printing function again.
Example
Output parameters
code)
Example
settings)
Output parameters
Return SDK_OK Success
Other See this subcompact definition
59
(error code)
Data structure PrnStrFormatclass
private int textSize = 24;//string size, px
private boolean underline = false;//underline
private float textScaleX = 1.0f;//The horizontal scaling
parameter value of the font 0-1 indicates the reduction of the
font 1 indicates the normal size of 1 indicates the enlargement.
private float letterSpacing = 0f; //column spacing not
available
private Alignment ali = Alignment.ALIGN_NORMAL;
//alignment
private PrnTextStyle style = PrnTextStyle.NORMAL; //font
style
private PrnTextFont font = PrnTextFont.DEFAULT; //font
custom
The corresponding style class 1.
public enum PrnTextStyle {
NORMAL, BOLD, ITALIC, BOLD_ITALIC, ;
}
The corresponding style class 2.
public enum PrnTextFont {
DEFAULT("DEFAULT", 1) /* conventional font */,
DEFAULT_BOLD("DEFAULT_BOLD", 2) /* bold */,
MONOSPACE("MONOSPACE", 3) /* equal width */,
SANS_SERIF("SANS_SERIF", 4)/* sans serif */,
SERIF("SERIF", 5)/* serif */,
CUSTOM("CUSTOM", 6) /* custom */
}
Note This method is to use the dot matrix plot printing string method of
Example
60
code data
code
code
middle left)
Output parameters
Return SDK_OK Success
Example
61
code, ean-13 code and so on a variety
of.
Output parameters
Return SDK_OK Success
Other See this subcompact definition
(error code)
Data structure
Note This method is to use the dot matrix map printing bar code, the data
Example
alignment)
Output parameters
Return SDK_OK Success
code)
Data structure
Note This method is to use the dot matrix map printing bitmap, the data
Example
62
3.8.7 Start printing
additional information.
Example
The function of the PinPad class is mainly to deal Some features of enter the password keyboard
Input parameters
number of parameters.
63
code)
Data structure
Note
Example
algorithmMode);
Output parameters
code)
Example
keyLength)
64
Output parameters
code)
Data structure
Note
Example
index
Output parameters
code)
Data structure
Note
Example
65
pinKeyLength,byte[] macKeyData, byte macKeyLength,byte[] tdk,
byte tdkLength)
Output parameters
code)
Data structure
Note
Example
keyDataLength,PinEncryptTypeEnum transType)
transport type
Output parameters
66
code)
/* *
* plain text
*/
PlLAIN_TEXT((byte)0x00),
/* *
* encrypted text of the password
*/
CRYPTO_TEXT((byte)0x01);
Note
Example
encreypt encryption
code)
67
*/
Un _ encreypt (byte) 0x00);
Note
Example
code)
68
XOR((byte)0x04);
Note
Example
Describe
Input parameters keyIndex Key index
keyData Key
ksn KSN
Output parameters
Return SDK_OK Success
code)
Data structure
Note
Example
byte[] ksn)
Describe
Input parameters keyIndex Key index
69
inputDataLength Input data length
ksn KSN
code)
Data structure
Note
Example
Describe
Input parameters keyIndex Key index
ksn KSN
code)
Data structure
Note
Example
70
3.9.12Set the prompt information that pin entered.
confirmation key):
Output parameters
Return SDK_OK Success
code)
Data structure
Note
Example
71
allow
Algorithm type
parameters
code)
outData)
Describe
Input parameters mode When ucMode is 0, encrypt the
number)
72
the uccode is 0, and 16 bytes of data
code)
Data structure
Note
Example
allow
parameters
Return
Data structure
Note
Example
73
3.9.16Set password whether the input box is hidden.
keyModeEnum);
Output parameters
Return
/**
* the default needs to display its own input box.
*/
DEFAULT,
/**
* this parameter indicates a hidden input box that requires
a custom input box
*/
NO_INPUTVIEW;
}
Note When you need a custom password input box, this needs to be set.
Example
3.9.17Set edittext to use the password keyboard (after the password entry
box is hidden)
Describe Set the password input box to hide the desired edit objects that
keyboard.
74
Output parameters
Return
Data structure
Example
The fingerprint module is responsible for providing functions such as opening, closing, fingerprinting, verification, and
deletion of the fingerprint module.
Get the object of the FingerprintManager class:
FingerprintManager fingerprintManager= manager.get FingerprintManager ();
3.8.1 Initialize
Describe Initialize
Input parameters
Output parameters
Data structure
Note
Example
3.8.1 Close
Input parameters
75
Output parameters
Data structure
Note
Example
3.8.1 Capture
Describe Capture
Output parameters
Return
Data structure
Example
Output parameters
Return
Data structure
Example
76
3.8.1 Capture ISO feature
Output parameters
Return
Data structure
Example
3.8.1 Enrollment
Method name public void enrollment(int fingerId, int count, int timeout)
Output parameters
Return
Data structure
callback
Example
77
3.8.1 Authenticate
Describe Obtain the currently pressed finger fingerprint feature and the
Output parameters
Return
Data structure
onAuthenticationFailed()
Example
3.8.1 Authenticate
Describe Get the 1:1 comparison between the currently pressed finger
library.
Output parameters
Return
Data structure
onAuthenticationFailed()
Example
78
3.8.1 Remove fingerprint
Output parameters
Return
Data structure
Note
Example
Input parameters
Output parameters
Return
Data structure
Note
Example
Input parameters
79
Output parameters
}
Note
Example
Describe Get the list of enrolled IDs in the device fingerprint library
Input parameters
Output parameters
}
Note
Example
80
3.8.2 Generate a Bitmap and store it to the specified path
Output parameters
Data structure
Example
Output parameters
Return
Data structure
Note
Example
81
Output parameters
Return
Data structure
Note
Example
1.2 External card slot module (for exclusive external card slot)
1.1.7 ExternalCardManager 类
The function of the ExternalCardManager class is mainly to process the card search of the external card slot and obtain
the card object.
Get the object of the CardReaderManager class:
ExternalCardManager cardManager= manager.getExternalCardManager()
Method name public void searchCard(final byte slot, final int timeout, final
OnSearchCardListener listener)
82
Note
Example
83
1.1.8 IC card
The ICard class is basically some operations such as data interaction on the ic card.
Get the object of the ICCard class
ICCard icCard = externalCardManager.getICCard()
1.1.1.1 Reset
receiveLength)
Describe Reset
Input parameters slotNo Slot no, 0~F
Output parameters receiveLength Reset response length
receiveAtr Reset response data
Return SDK_OK Success
Other See this subcompact definition
(error code)
Data structure
Note
Example
1.1.1.2 Reset
Describe Reset
Input parameters slotNo Slot no, 0~F
Output parameters
Return SDK_OK Success
Other See this subcompact definition
(error code)
84
Data structure
Note
Example
code)
Data structure
Note
Example
Method name public int icExchangeAPDU (byte slotNo, byte [] send Data, byte []
receiveData,int[] reveiceLength )
85
Other See this subcompact definition (error
code)
Data structure
Note
Example
The string tools class is mainly used for data transformation between the text and the string.
86
3.13.1Converts a 16 th string into an array of byte.
Data structure
Note
Describe
Data structure
Note
Example
Data structure
87
Note
Data structure
Note
Describe
Data structure
Note
Describe
Data structure
88
Note
3.13.7Convert int into four bytes in large terminal mode byte [].
Describe
Data structure
Note
3.13.8Convert int into two bytes in large terminal mode byte [].
Describe
Data structure
Note
3.13.9Convert int into four bytes in small terminal mode byte [].
Describe
Data structure
Note
89
3.13.10 Convert four bytes of byte [] into int in large terminal mode.
Describe
Data structure
Note
3.13.11 Converts four bytes of byte [] into int in small terminal mode.
Describe
Data structure
Note
Method name public static byte[] subByte(byte[] array,int offset, int length)
Describe
Data structure
Note
90
3.13.13 Combine two numbers into an array.
Describe
array2
Data structure
Note
Method name public static byte[] concat(byte[] array1, int beginIndex1, int
Describe
array2 Array 2
Data structure
Note
Describe
91
Output parameters byte[]
Data structure
Note
3.14.1OnSearchCardListener
3.14.2OnPinPadInputListener
92
* password pinblock information
*/
void onSuccess(byte[] pinBlock);
}
3.14.3BluetoothListener(for Mpos)
/**
* Callback when starting connection
* @param device
*/
public void startedConnect(BluetoothDevice device);
/**
* Callback when the connection is successful
* @param device
*/
public void connected(BluetoothDevice device);
/**
* Callback when canceling connection
*/
public void disConnect();
/**
* Callback when starting to search for devices
*/
public void startedDiscovery();
/**
* Callback when ending the search
*/
public void finishedDiscovery();
}
93
3.14.4OnBluetoothEmvListener(For Mpos)
/**
* Callback when the cancel button is pressed
*/
public void onKeyCancel();
/**
* Callback when card is detected
* @param cardDetected card type
*/
public void onCardDetect(CardDetectedEnum cardDetected);
/**
* Callback when executing emv timeout
*/
public void onEmvTimeout();
/**
* Callback when entering password timeout
*/
public void onEnterPasswordTimeout();
/**
* Callback when Emv succeeds or fails
* @param emvStatus
*/
public void onEmvStatus(EmvStatusEnum emvStatus);
}
3.14.5UpdateListener
94
void onSuccess();
/**
* Update progress callback
*
* @param current Current transfer firmware byte
* @param max Total firmware length
*/
void onProcessChange(long current, long max);
/**
* Callback when the update fails
*
* @param errCode {@link SdkResult}
* @param msg
*/
void onError(int errCode, String msg);
}
3.14.6FingerprintListener
/**
* Fingerprint auth failed
*
* @param reason
*/
public void onAuthenticationFailed(int reason);
/**
* Fingerprint auth succeeded
*
95
* @param fingerId Fingerprint Id
* @param result
*/
public void onAuthenticationSucceeded(int fingerId, Object obj);
/**
* Get fingerprint image
*/
public void onGetImageComplete(String result, byte[] imgBuff);
/**
* Get fingerprint feature
*
* @param result
* @param feature
*/
public void onGetImageFeature(int result, byte[] feature);
/**
* Get fingerprint ISO features
*
* @param result
* @param feature
*/
public void onGetImageISOFeature(int result, byte[] feature);
}
//ic card
public static final int SDK_ICC_BASE_ERR = -1200;
public static final int SDK_ICC_ERROR = (SDK_ICC_BASE_ERR -1); //Error
public static final int SDK_ICC_PARAM_ERROR = (SDK_ICC_BASE_ERR -2); //Param error
public static final int SDK_ICC_NO_CARD = SDK_ICC_BASE_ERR-3; //Slot no card
96
public static final int SDK_ICC_NO_RESP = SDK_ICC_BASE_ERR-4; //Timeout no response
public static final int SDK_ICC_COMM_ERR = SDK_ICC_BASE_ERR-5; // Card communication
error (parity error or LRC error)
public static final int SDK_ICC_RESP_ERR = SDK_ICC_BASE_ERR-6; // Card return
information error
public static final int SDK_ICC_NO_POWER_ON = SDK_ICC_BASE_ERR-7; // Card is not power on
//SLE4442
public static final int SDK_SLE4442_BASE_ERR = -1200;
public static final int SDK_SLE4442_ERROR = SDK_SLE4442_BASE_ERR - 1;//Error
public static final int SDK_SLE4442_PARAM_ERROR = SDK_SLE4442_BASE_ERR - 2;//Param error
public static final int SDK_SLE4442_NO_CARD = SDK_SLE4442_BASE_ERR - 3; // Slot no card
public static final int SDK_SLE4442_DETECT_ERR = SDK_SLE4442_BASE_ERR - 0xB0;//SLE4442
detect error
public static final int SDK_SLE4442_KEY_ERR = SDK_SLE4442_BASE_ERR - 0xB1;//Key error
public static final int SDK_SLE4442_KEY_NO_COUNT = SDK_SLE4442_BASE_ERR - 0xB2; // Key no
count, the card has been scrapped
public static final int SDK_SLE4442_WRITE_ERR = SDK_SLE4442_BASE_ERR - 0xA9;//Write error
public static final int SDK_SLE4442_ADDR_DATA_DIFF_ERR = SDK_SLE4442_BASE_ERR - 0xA9;// The
corresponding location data is different
public static final int SDK_SLE4442_CHANGE_KEY_ERR = SDK_SLE4442_BASE_ERR - 0xA9; //Change key
failed
//SLE4428
public static final int SDK_SLE4428_BASE_ERR = -1200;
public static final int SDK_SLE4428_ERROR = SDK_SLE4428_BASE_ERR - 1; //Error
public static final int SDK_SLE4428_PARAM_ERROR = SDK_SLE4428_BASE_ERR - 2; //Param error
public static final int SDK_SLE4428_NO_CARD = SDK_SLE4428_BASE_ERR - 3; // Slot no card
public static final int SDK_SLE4428_DETECT_ERR = SDK_SLE4428_BASE_ERR - 0xB3; // SLE4428
detect error
public static final int SDK_SLE4428_KEY_ERR = SDK_SLE4428_BASE_ERR - 0xB4; // Key error
public static final int SDK_SLE4428_KEY_NO_COUNT = SDK_SLE4428_BASE_ERR - 0xB5; // Key no
count, the card has been scrapped
public static final int SDK_SLE4428_WRITE_ERR = SDK_SLE4428_BASE_ERR - 0xA9; //Write error
public static final int SDK_SLE4428_WRITE_PRO_ERR = SDK_SLE4428_BASE_ERR - 0xAA; //Write error
public static final int SDK_SLE4428_CHANGE_KEY_ERR = SDK_SLE4428_BASE_ERR - 0xB6; ///Change key
failed
//rf card
public static final int SDK_RF_BASE_ERR = -1300;
public static final int SDK_RF_ERROR = (SDK_RF_BASE_ERR-1); //Error
public static final int SDK_RF_PARAM_ERROR = (SDK_RF_BASE_ERR-2); //Param error
public static final int SDK_RF_ERR_NOCARD = (SDK_RF_BASE_ERR-3); // No cards found
public static final int SDK_RF_ERR_CARD_CONFLICT = (SDK_RF_BASE_ERR-4); // Multi-card
conflict
public static final int SDK_RF_TIME_OUT = (SDK_RF_BASE_ERR-5); // TIME OUT ERROR
97
public static final int SDK_RF_PROTOCOL_ERROR = (SDK_RF_BASE_ERR-6); // PROTOCOL ERROR
public static final int SDK_RF_TRANSMISSION_ERROR = (SDK_RF_BASE_ERR-7); // Transmission
error
//magnetic card
public static final int SDK_MAG_BASE_ERR = -1100;
public static final int SDK_MAG_ERROR = (SDK_MAG_BASE_ERR-1); //Error
public static final int SDK_MAG_PARAM_ERROR = (SDK_MAG_BASE_ERR-2); //Param error
public static final int SDK_MAG_NO_BRUSH = (SDK_MAG_BASE_ERR-3);//No brush card
//printer
public static final int SDK_PRN_BASE_ERR = -1400;
public static final int SDK_PRN_ERROR = (SDK_PRN_BASE_ERR-1) ; //Error
public static final int SDK_PRN_PARAM_ERROR = (SDK_PRN_BASE_ERR-2) ; //Param
error
public static final int SDK_PRN_STATUS_PAPEROUT = (SDK_PRN_BASE_ERR-3) ; //Paper out
public static final int SDK_PRN_STATUS_TOOHEAT = (SDK_PRN_BASE_ERR-4) ; //Too heat
public static final int SDK_PRN_STATUS_FAULT = (SDK_PRN_BASE_ERR-5) ; //Device
fault
public static final int SDK_PRN_STATUS_PRINTING = (SDK_PRN_BASE_ERR-6) ; //Is printing
//PinPad
public static final int SDK_PAD_BASE_ERR = -1500 ;
public static final int SDK_PAD_ERR_NOPIN = (SDK_PAD_BASE_ERR -10); //press ENTER
directly when enter PIN (no PIN)s
public static final int SDK_PAD_ERR_CANCEL = (SDK_PAD_BASE_ERR-11); //press CANCEL
to quit enter PIN
public static final int SDK_PAD_ERR_TIMEOUT = (SDK_PAD_BASE_ERR-12); //timeout when
enter PIN
public static final int SDK_PAD_ERR_NEED_WAIT = (SDK_PAD_BASE_ERR-13); //two frequent
between 2 sensitive API, call PIN less than 30s
public static final int SDK_PAD_ERR_DUPLI_KEY = (SDK_PAD_BASE_ERR-14); //duplicate key
public static final int SDK_PAD_ERR_INVALID_INDEX = (SDK_PAD_BASE_ERR-15); //invalid key
index
public static final int SDK_PAD_ERR_NOTSET_KEY = (SDK_PAD_BASE_ERR-16); //not set key
(no key)
public static final int SDK_PAD_ERR_EXCEPTION = (SDK_PAD_BASE_ERR-17); // The password
keyboard is not working properly.
//silent install
public static final int SDK_INSTALL_SUCCESS = 0; // Silent
installation/uninstallation succeeded
public static final int SDK_INSTALL_ERROR = -1; // Silent
98
installation/uninstallation failed
public static final int SDK_INSTALL_NONE = 1000;//Default status
public static final int SDK_INSTALLING = 1; // Silent
installation/uninstallation in progress
public static final int SDK_NO_SIGNATURE = -2; // Apk no signature
public static final int SDK_SIGNATURE_ERROR = -3; // Signature error
FingerResult
99