Number Code Type CodeID Zebra CodeID Newland CodeID Fp/NL  Notice   Example  
1 Code128 D j j Newland,Fp/NL:
AIM-128 — f
SETTING 128 — t
2 UCC·EAN128(GS1-128)   j u        
3 ISBT 128 D j  j  Zebra:
ISBT 128 Concatenated — D
4 EAN8 A d g        
5 EAN13 A d d        
6 UPC-E A c h        
7 UPC-E1 A            
8 UPC-A A c c   Instruction
9 Interleaved 2 of 5(ITF) F e e Newland,:
ITF-6 —  e
ITF-14 — e 
ITF-6 —  r
ITF-14 — q
Head noun Paraphrase Scanner ID
10 Matrix 2 of 5 S v v   Nls NewLand (EM2096) ]N
11 Code39 B b b Zebra:
Trioptic Code 39 — M 
Zebra Zebra (4710) ]Z
12 Codabar C a a   Fp(Falcon) Falcon(BSM1825) ]FN
13 Code93 E i y   NL NewLand(EM1365) ]FN
14 GS1 DataBar(RSS) R R R        
15 Composite-UCC T     Zebra:
MiroQRTCIF Linked Code 39(TLC 39) — T 
16 Composite-UPC              
17 Code11 H H z        
18 ISBN(Bookland EAN) L B B   Return: Scanner ID+Code ID  
19 Industrial 2 of 5   D i        
20 Standard 2 of 5   s s   Example:
code content:123456 
code type:code 128


21 Discrete 2 of 5(DTF) G            
22 Chinese 2 of 5 U            
23 Korea 3 of 5 V            
24 Plessey   p p Newland:
UK Plessey — p
25 MIS-Plessey J m m        
26 Composite A/B              
27 Composite C              
28 ISSN EAN X n n        
29 PDF417 X r          
30 QR Code P01 Q          
31 Aztec z            
32 DataMatrix P00 u          
33 HanXin P0H h          
34 MaxiCode P02            
35 AustralinPostal P08            
36 US Postnet P03            
37 US Planet P04            
38 Uk Postal P06            
39 Japan Postal P05            
40 Deutsche 12   l l        
41 Deutsche 14   w w        
42 Code32 B b b         
43 Netherlands KIX Code P08            
44 USPS 4CB/One Code/Intelligent Mail P0A            
45 UPU FICS Postal P0B            
46 Signature Capture P0X            
47 Coupon Code N            

Scan code driver

Why to apply the code scanning driver
encapsulated by Sunmi

Sunmi has provided the code scanning driver
matching its own devices. Compared to the currently applied open source
solution, Sunmi code scanning driver has the following five advantages

High recognition rate. Through a
lot of tests simulating real scenarios, Sunmi code

scanning driver has increased by 74% in
average in terms of code scanning recognition rate compared to the commonly
used code scanning solution based on ZXing open source project.

Compared to ZXing solution, it
has increased by above 100% in terms of code scanning

speed of 1 D code.

Simpler usage mode. You can add
code scanning function in your own project just by use

of five lines of code.

Up to 15 types of code to
support scanning. More code types will be added subsequently.

It perfectly matches the Sunmi
devices. The combination of software with hardware can

ensure highly efficient & stable

How to use Sunmi code scanning driver

There are two methods available for the
developers to use Sunmi code scanning driver

The developer’s App invokes the
code scanning module integrated by Sunmi system to

complete code scanning and obtains the
return value. This is a simple & easy to use method.

Write the camera interface by
himself/herself and invoke the code scanning driver

encapsulated by Sunmi to complete the
picture parse. This is a relatively complicated method, but it provides a
higher degree of freedom.

The first type of usage mode:

To reduce the development difficulty, Sunmi
set a built-in code scanning module in the newest SUNMI OS (V1 firmware version
187, M1 firmware version 37) system. The developer invokes Sunmi code scanning
module where it is necessary to invoke code scanning for the project via
startActivityForResult(), and then receives the return value of the code
scanning result in onActivityResult() method.

Receive the returned parameters of the code
scanning result in onActivityResult method. You may refer to the following



    *Creating a Intent at where you want start scanner, calling the scanner by startActiityForResult();


    Intent intent = new Intent("com.summi.scan");




    * The method is the same function as above 

    *Intent intent = new Intent("com.summi.scan");

    *intent.setClassName("com.sunmi.sunmiqrcodescanner", "com.sunmi.sunmiqrcodescanner.activity.ScanActivity");



    //there is also some options item about the scanner module, you can transfer parameters to control some settings, each item has a defaut status,transform parameter is not necessary,

    intent.putExtra("CURRENT_PPI", 0X0003);//The current preview resolution ,PPI_1920_1080 = 0X0001;PPI_1280_720 = 0X0002;PPI_BEST = 0X0003;

    intent.putExtra("PLAY_SOUND", true);// Prompt tone after scanning  ,default true

    intent.putExtra("PLAY_VIBRATE", false);//vibrate after scanning,default false,only support M1 right now.

    intent.putExtra("IDENTIFY_INVERSE_QR_CODE", true);//Whether to identify inverse code

    intent.putExtra("IDENTIFY_MORE_CODE", false);// Whether to identify several code,default false        

    intent.putExtra("IS_SHOW_SETTING", true);// Wether display set up button  at the top-right corner,default true

    intent.putExtra("IS_SHOW_ALBUM", true);// Wether display album,default true


    startActivityForResult(intent, START_SCAN);

The second type of usage mode:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
                if (requestCode == 1 && data != null) {
                        Bundle bundle = data.getExtras();
                        ArrayList> result = (ArrayList>) bundle
                        Iterator> it = result.iterator();

                        while (it.hasNext()) {
                                HashMap hashMap =;
                                Log.i("sunmi", hashMap.get("TYPE"));//this is the type of the code 
                                Log.i("sunmi", hashMap.get("VALUE"));//this is the result of the code 

                super.onActivityResult(requestCode, resultCode, data);

In principle, the developer is required to realize
the basic knowledge of android customized camera before developing his/her own
code scanning function by directly applying Sunmi code scanning library. Please
download resource file to check code comments in it. The basic usage
method for Sunmi code scanning driver is explained based on SunmiScanDemo as
follows, and this Demo is an eclipse project.

Add four library files of,, and
according to the following hierarchy in
libs directory of the project.

Introduce header files &
decoding library into the code to handle business. You may refer

to DEMO.

import com.sunmi.scan.Config;
import com.sunmi.scan.Image; 
import com.sunmi.scan.ImageScanner; 
import com.sunmi.scan.Symbol;
import com.sunmi.scan.SymbolSet; 

Initialization and

private ImageScanner scanner;// declare the scanner
scanner = new ImageScanner();// create a scanner
scanner.setConfig(0, Config.X_DENSITY, 2);// the interval time of line
scanner.setConfig(0, Config.Y_DENSITY, 2);//the interval time of raw
scanner.setConfig(0, Config.ENABLE_MULTILESYMS, 0);
//turn on the multiple parse in one picture, 0 means one , 1 means multiple
scanner.setConfig(0, Config.ENABLE_INVERSE, 0);// turn on the reserve color ?
scanner.setConfig( Symbol.QRCODE,Config.ENABLE, 1);//enable QR, 1:enable(default);0:disable
scanner.setConfig( Symbol.PDF417,Config.ENABLE, 1);//enable PDF417, 1:enable;0:disable(default)
scanner.setConfig(Symbol.DataMatrix, Config.ENABLE, 1);//enable DataMatrix, 1:enable;0:disable(default)
scanner.setConfig(Symbol.AZTEC, Config.ENABLE, 1);//enable AZTEC, 1:enable;0:disable(default)

Pass the image data and
decoding. The following code can be written in the method

PreviewCallback.onPreviewFrame(byte[] data,
Camera camera).


    creating image,width is the preview image's width and  height is the preview image's height,generally speaking,high generally speaking also means clearer image,but slower decoding speed.cause the decoding arithmetic need the the original data and the default format of the preview image is YCbCr_420_SP,you must transform the fromat, parameter "Y800" is the format of image what you want transform.


    Image source = new Image(width, height, "Y800");


    *Set the scan area


    Rect cropRect = finder_view.getScanImageRect(size.height, size.width);//finder_view is the custom widget of the demo


    /*filling the data, this is the source data of camera*/


    /*decoding ,return value 0 means failure,>0 means successful*/

    int result = scanner.scanImage(source); 

    Rect cropRect = finder_view.getScanImageRect(size.height, size.width);


    /*filling the data,this is the source data of camera*/


    /*decode,returned value 0 means failure,>0 means success*/

    int result = scanner.scanImage(source); 

5.      Obtain the decoding result and
the type of bar code.

    if (result != 0) {


        SymbolSet syms = scanner.getResults();

            for (Symbol sym : syms) {   

              Log.i("sunmi", "type:"+sym.getSymbolName());//code type,such as “EAN-8”

              Log.i("sunmi","result:"+sym.getResult())//getting the result




More descriptions

The code scanning types currently supported
by Sunmi code scanning driver include the following ones:
• 1 D code:
EAN-13, UPC-A, UPC-E, Codabar, Code39, Code93, Code128, ISBN10, ISBN13,
DataBar, DataBar Expanded, Interleaved 2 of 5
• QR code: QR Code,

Code scanning base

Code scanning base

Functions introduction


1.       USB port extension

2.       Charging

3.       Code scanning

Demo download

Code Scanner Head Engine(Infrared scan code)

For detailed software programming, please refer to User Guide:

L2 UserGuide

There are two specs for your choice of selection.

Zebra                                                    Newland

As for L2, two types of scanner configurations are available for options, namely New World & Zebra

As for V2 and P2lite, two types of scanner configurations are available for options Different code scanners support different types of codes

L2 New World scanner supports the following code types:


L2 Zebra scanner supports the following code types


P2lite and V2 scanner support the following code types:


1. Select the recognizable codes

The user can select opening or closing recognizable codes formulation, enable by default all the recognizable codes.


2. Coding Method

The user can carry out the setting of output coding in setting
Default utf8

3.   Prompting Mode

The user can carry out the setting of prompting mode in setting

Turn on by default sound prompt and vibration prompt

4. Output Method

The user can carry out the output method setting of code scanning results in setting

Select by default the output method of simulated keyboard, complement

Enter by default automatically

Enable by default the broadcast output

5.  Trigger Mode

The user can select trigger mode in setting

Short press by default to trigger code scanning, and the code scanner will automatically go out after successful code scanning

The expressive phenomena of New World and Zebra code scanner are different in short press trigger and continuous code scanning options

When the device is New World code scanner, and short press trigger is selected, the code scanner will automatically enter the continuous code scanning mode after continuous code scanning. The code scanner will go out after staying lit for a certain period of time, and then light again to start scanning, recycle like this

When the device is Zebra code scanner, and short press trigger is selected, the device will automatically enter the continuous code scanning mode after continuous code scanning. The code scanner will stay lit. Unless the code scanning key is pressed again, the code scanner lighting will not go out, and the same code will be output only once.


1.Question: how to dock code scanner

Answer: for the convenience of developers, Sunmi has made the code scanner a development-free device. General users can obtain the code scanning content without development against the code scanner

2.Question: how to obtain the code scanning result

Answer: Sunmi has provided three types of data output methods.

1)Simulated keyboard: it will simulate the code scanning result into button event, and will automatically output it to the focus frame text. The user can obtain the code scanning result by obtaining the focus frame content or monitoring the button event;

2) Direct filling: it will copy the code scanning result onto the clipboard and automatically output it to the focus frame text. Compared to the output method of simulated keyboard, direct filling has a faster output speed;

3) Broadcast output: it will broadcast the code scanning result and the user
can monitor the broadcast to obtain the code scanning result.

3. Question: inconsistent continuous code scanning result

Answer: the input method will affect the input result of code scanning. It is already known that the input method of Baidu millet version will affect the output of code scanning result, and you can replace it with Google pinyin input method.

4. Question: the code scanning result is slow to get

Answer: if you have selected the output method of simulated
keyboard, the button interval time will affect the output speed. You will get
the fastest speed when the setting is zero. (zero by default)

5. Question: camera code scanning needs to be compatible with scanner code scanning

Answer: L2 Zebra code scanner and the camera cannot be enabled at the same time. The user can distinguish Sunmi device from other devices by
judging its model. To use side key for code scanning on Sunmi devices

6. Question: software triggers code scanning

Answer: you can refer to aidl port in L2 User Guide. The code scanning service provides the port for soft trigger.

7. Question: messy codes occur when scanning Chinese QR code

Answer: when analyzing QR code with Chinese, it is necessary to match the output coding with the coded format of Chinese in QR code. For example: the coded format of the Chinese in QR code — “你好” is UTF-8; “你好” can only be correctly output by setting UTF-8 in terms of the output coding of code scanner, otherwise messy codes will be output.

Camera Code Scanning

Aimed at Sunmi devices, Sunmi provides code scanning assembly and SO library, to enable faster QR code & bar code identification.

The currently supported code scanning types include the following:

1.      One dimensional code:

EAN-8, EAN-13, UPC-A, Codabar, Code39,
Code93, Code128, ISBN10, ISBN13, DataBar, DataBar Expanded, Interleaved 2 of 5

2.      QR code:

QR Code, PDF417

Sunmi’s code scanning assembly and SO library only support the usage on Sunmi devices.

The invocation method of T1mini camera: the user can directly use the camera provided by android to invoke api and operate the camera.

T1mini camera
(If the user transplants the code scanning function of handheld device onto
T1mini, it is necessary to adjust the resolution and the size of the display