Newland Android PDA
API Handbook

Revision History
VersionV1.0.0V1.0.1

Description
Initial release.
Updated the “Change the Scanner Settings” and “ReservedKeys” sections, and added the “Appendix” section.

Date
January 16, 2018
June 19, 2018

V1.0.2

Added the “Configuring Symbologies” section.

March 25, 2019

V1.03

Updated the “Scan Barcode” and “Stop Scanning” sections

May 31, 2019

V1.04

Updated the “Configuring Scanner Parameters” section

Step.9, 2020

Added raw data interface for scan result byte.
V1.05

Added settings for NFC, positioning, soft keyboard andJun.6,2022

APN.

V1.06

Added the “Enable or Disable Recent Apps” section
Added the “Delay Mode” option
Added the “Send Scan Fail Broadcast” option
Added the “DOTCODE” symbology
Added the “Advanced Settings” section.

Jun.29,2022

V1.07

Updated the “EXTRA_SCAN_SETTINGS_RESTORE”
sectionUpdated the “EXTRA_SCAN_AUTOENT” section.
Updated the “EXTRA_TRIG_MODE” section.
Updated the default setting of “SCAN_ENCODE”.
Deleted the table of “programmable barcode parameters”.
Deleted the table of Advanced Settings.

April.6, 2023

目次
このマニュアルについて...................................................................................................................................... 1
開発環境 ............................................................................................................................................................... 1
製品型番の取得 .................................................................................................................................................... 1バーコードスキャナー ......................................................................................................................................... 1
バーコードのスキャン .................................................................................................................................. 1
バーコードデータの取得 .............................................................................................................................. 2
スキャンの停止 ............................................................................................................................................. 3
スキャナー設定の変更 .................................................................................................................................. 4
スキャナーパラメータの設定 ....................................................................................................................... 4
シンボロジーの設定 ..................................................................................................................................... 6
予約済みキー (リザーブキー) ............................................................................................................................ 7
その他の API ........................................................................................................................................................ 8
通知バーのプルダウン .................................................................................................................................. 8
ホームキーからデスクトップの切替 ............................................................................................................ 8
システム時刻の設定 ...................................................................................................................................... 8
NFC、位置情報、ソフトキーボード、APN の設定 ..................................................................................... 9
最近使用したアプリの有効または無効....................................................................................................... 15
備考 .................................................................................................................................................................... 16
Symbology ID Number ................................................................................................................................ 16

このマニュアルについて開発環境

製品モデル番号の取得

バーコードスキャナー
バーコードのスキャン

Example 1:
Intent intent = new Intent ("nlscan.action.SCANNER_TRIG");
mContext.sendBroadcast(intent);

1

Example 2:
Intent intent = new Intent ("nlscan.action.SCANNER_TRIG");intent.putExtra("SCAN_TIMEOUT", 4);// SCAN_TIMEOUT value: int, 1-9; unit: second
intent.putExtra("SCAN_TYPE ", 2);// SCAN_TYPE: read two barcodes during a scan attempt
mContext.sendBroadcast(intent);
注意: スキャンとデコードセッションが進行中の場合、上記のブロードキャストを送信すると、進行中のセッションが停止します。スキャンキーを押してバーコードをスキャンする場合、下層で処理されるため、アプリケーションは Scan KeyPress イベントを取得する必要がなく、ブロードキャストを送信する必要もありません。

バーコードデータの取得
バーコードデータの取得方法は 3 つあります：
１．EditText に直接入力する：スキャンされたデータを EditText の現在のカーソル位置に出力します。
２．キーストロークをシミュレートする：スキャンされたデータをキーボードバッファに出力し、キーボード入力をシミュレートしてテキストボックスの現在のカーソル位置にデータを取得します。
３．API 経由で出力する：アプリケーションは、ブロードキャストレシーバを登録して特定のブロードキャストインテントを聞くことで、スキャンされたデータを取得します。
・Broadcast: nlscan.action.SCANNER_RESULT
バーコードデータを取得するために使用します。
・Extra scan result 1 parameter: SCAN_BARCODE1
バーコード 1 のデータを取得するために使用します。
Type: String
・Extra scan result 1 raw byte parameter: scan_result_one_bytes
バーコード 1 のバイトデータを取得するために使用します。
Type: byte[]
・Extra scan result 2 parameter: SCAN_BARCODE2
バーコード 2 のデータを取得するために使用します。
Type: String
・Extra scan result 2 raw byte parameter: scan_result_two_bytes
バーコード 2 のバイトデータを取得するために使用します。
Type: byte[]
・Extra symbology ID number parameter: SCAN_BARCODE_TYPE
Type: int（-1 はシンボル ID 番号の取得に失敗したことを示します）
スキャンされたバーコードの ID 番号を取得するために使用します（バーコードの種類については備考の「シンボル ID 番号」表を参照してください）。
・Extra scan state parameter: SCAN_STATE（値: fail または ok）
スキャン操作のステータスを取得するために使用します:2Value = fail, 操作が失敗
Value = ok, 操作が成功
Type: String
Example:Register broadcast receiver:mFilter= newIntentFilter("nlscan.action.SCANNER_RESULT");
mContext.registerReceiver(mReceiver, mFilter);Unregister broadcast receiver:mContext.unregisterReceiver(mReceiver);Get barcode data:mReceiver= newBroadcastReceiver() {@Override
publicvoidonReceive(Context context, Intent intent) {final String scanResult_1=intent.getStringExtra("SCAN_BARCODE1");
final String scanResult_2=intent.getStringExtra("SCAN_BARCODE2");// Raw byte data of the scan result
final byte[] scanResultByte_1=intent. intent.getByteArrayExtra("scan_result_one_bytes");
final byte[] scanResultByte_2= intent. intent.getByteArrayExtra("scan_result_two_bytes");
final int barcodeType = intent.getIntExtra("SCAN_BARCODE_TYPE", -1); // -1:unknown
final String scanStatus=intent.getStringExtra("SCAN_STATE");
if("ok".equals(scanStatus)){//Success}else{//Failure, e.g. operation timed out}}};

スキャンの停止3

nlscan.action.STOP_SCAN

Example:Intent stopIntent = new Intent(“nlscan.action.STOP_SCAN”);
mContext.sendBroadcast(stopIntent);

スキャナー設定の変更
スキャナーパラメータの設定
アプリケーションは、最大 3 つのパラメーターを含むことができるブロードキャスト
ACTION_BAR_SCANCFG をシステムに送信することにより、スキャナーの有効化/無効化などの 1 つ以上のスキャナーパラメータを設定できます。

Parameter

EXTRA_SCAN_POWER

TypeINTDescription (* indicates default)
Value = 0 Disable scanner= 1 Enable scanner*
Note:

Value = 0=1=2= 4
EXTRA_TRIG_MODE

Level mode
Continuous mode
Pulse mode*
Delay mode(INTAcuscan Decoding

EXTRA_SCAN_MODE

INT

SEND_SCAN_FAIL_BROAD
CAST

INT

EXTRA_SCAN_AUTOENTINTEXTRA_SCAN_NOTY_SND

INTValue = 1=2=3
Value = 0=1)
Fill in EditText directly*
Simulate keystroke
Output via API
Disable the send scan fail braoadcast
Enable the send scan fail braoadcast*

Value = 0 Do not add a line feed*= 1 Add a line feed
Send an Enter Key after each barcode is scanned.
Value = 0 Sound notification off= 1 Sound notification on*

4EXTRA_SCAN_NOTY_VIB

INTEXTRA_SCAN_NOTY_LED

INT

SCAN_TIMEOUTLONG

SCAN_INTERVALLONG

TRIGGER_MODE_MAIN

INT

TRIGGER_MODE_LEFT

INT

TRIGGER_MODE_RIGHTINT

TRIGGER_MODE_BLACKINT

NON_REPEAT_TIMEOUTLONG

SCAN_PREFIX_ENABLE

INT

SCAN_SUFFIX_ENABLE

INT

SCAN_PREFIXSTRING

SCAN_SUFFIXSTRING

SCAN_ENCODEINTOUTPUT_RECOVERABLE

BOOLEANEXTRA_OUTPUT_EDITOR_ACTION_ENABLE

INT

EXTRA_OUTPUT_EDITOR_ACTIONINT

Value = 0 Vibration notification off*
= 1 Vibration notification on
Value = 0 LED notification off= 1 LED notification on*
Set decode session timeout (millisecond)
Value = 0-9000; default: 3000*
Set timeout between decode sessions (millisecond)
Value >= 50; default: 500*
Value = 0 Disable the Scan key on front panel as scan trigger= 1 Enable the Scan key on front panel as scan trigger*
Value = 0 Disable the Scan key on left side as scan trigger= 1 Enable the Scan key on left side as scan trigger*
Value = 0 Disable the Scan key on right side as scan trigger= 1 Enable the Scan key on right side as scan trigger*
Value = 0 Disable the trigger on pistol grip as scan trigger= 1 Enable the trigger on pistol grip as scan trigger*(Precondition: The terminal supports this feature)
Set reread delay (millisecond)
Value = 0 Reread same barcode with no delay*> 0 Do not allow to reread same barcode before thedelay expires
Value = 0 Disable prefix= 1 Enable prefix*
Value = 0 Disable suffix= 1 Enable suffix*
Set prefix
Value = Hexadecimal value of prefix character; default: null*e.g. 0x61 should be entered as 61.
Set suffix
Value = Hexadecimal value of suffix character; default: null*e.g. 0x61 should be entered as 61.
Character encoding
Value = 1 UTF-8= 2 GBK= 3 ISO-8859-1= 4 AUTO*= 5 OtherShould enter the value of SCAN_OTHER_ENCODE at thesame time
= 6 windows-1251
Value = true Enable overwrite output= false Disable overwrite output*
Value = 0 Disable software key event output *= 1 Enable software key event output
Value = 0 IME_ACTION_UNSPECIFIED= 1 IME_ACTION_NONE= 2 IME_ACTION_GO= 3 IME_ACTION_SEARCH

5BROADCAST_OUTPUT_ACTION
BROADCAST_OUTPUT_EX
TRA_KEY_RESULT_1
BROADCAST_OUTPUT_EX
TRA_KEY_RESULT_2
BROADCAST_OUTPUT_EX
TRA__KEY_BARCODE_TY
PE
BROADCAST_OUTPUT_EX
TRA__KEY_BARCODE_TY
PE_NAMEEXTRA_SCAN_SETTINGS_RESTORESTRING= 4 IME_ACTION_SEND= 5 IME_ACTION_NEXT= 6 IME_ACTION_DONE *= 7 IME_ACTION_PREVIOUS
Broadcast output settings
Action value
Broadcast output settings
Barcode Result 1 parameterSTRING

Broadcast output settings
Barcode Result 2 parameter

STRING

Broadcast output settings
Barcode type parameter

STRING

Broadcast output settings
Barcode type name parameter

STRING

BOOLEAN

Value = true Restore the default settings

Example 1: Disable scanner
Intent intent = new Intent ("ACTION_BAR_SCANCFG");
intent.putExtra("EXTRA_SCAN_POWER", 0);mContext.sendBroadcast(intent);

Example 2: Output via API, add a line feed
Intent intent = new Intent ("ACTION_BAR_SCANCFG");
intent.putExtra("EXTRA_SCAN_MODE", 3);intent.putExtra("EXTRA_SCAN_AUTOENT", 1);
mContext.sendBroadcast(intent);

シンボロジーの設定
3

ACTION_BARCODE_CFG/

Parameter
CODE_IDTypeSTRING/

Description
Value = Barcode type6

PROPERTYSTRINGVALUESTRINGe.g. ”CODE128”
Value = Barcode parametere.g. ”Enable”, “Minlen”, or “TrsmtChkChar”
Value = Value of the barcode parametere.g. To enable a symbology, set the value to “1”Example: Transmit EAN-8 check character
Intent intent = new Intent ("ACTION_BARCODE_CFG");
intent.putExtra("CODE_ID", “EAN8”);
intent.putExtra("PROPERTY", “TrsmtChkChar”);
intent.putExtra("VALUE", “1”); // “1” Enable EAN-8, ”0” Disable EAN-8
mContext.sendBroadcast(intent);

予約済みキー(リザーブキー)(MT90F6)
MT65

F1 F2 F3 F4Example 1: Process the KeyDown event of reserved key
public boolean onKeyDown(int keyCode, KeyEvent event) {switch (keyCode){case KeyEvent.KEYCODE_F6:
showInfo("F6 KeyDown\n");break;}
return super. onKeyDown(keyCode,event);}
Example 2: Process the KeyUp event of reserved key
public boolean onKeyUp(int keyCode, KeyEvent event) {switch (keyCode){case KeyEvent.KEYCODE_F6:
showInfo("F6 KeyUp\n");break;}

74

return super.onKeyDown(keyCode, event);}

その他の API
通知バーのプルダウン
ENABLE/Extranlscan.action.STATUSBAR_SWITCH_STATE

true/false

Example: Disable the notification bar pull-down
Intent intent = new Intent("nlscan.action.STATUSBAR_SWITCH_STATE");
intent.putExtra("ENABLE", false);
context.sendBroadcast(intent);

ホームキーからデスクトップの切替/
nlscan.action.HOMEKEY_SWITCH_STATEENABLE
true/false

Extra

Example: Disable the feature of switching to desktopp by pressing the Home key
Intent intent = new Intent("nlscan.action.HOMEKEY_SWITCH_STATE");
intent.putExtra("ENABLE", false);
context.sendBroadcast(intent);

システム時刻の設定
nlscan.action.SET_TIME
Extra

TIME_MS

Example:Public long getTimeMillis(){Calendar c=Calendar.getInstance();c.set(2016,0,1,0,0,0);
return c.getTimeInMillis();}8

Intent it = new Intent("nlscan.action.SET_TIME");
long mills = getTimeMillis();it.putExtra("TIME_MS", String.valueOf(mills));
mContext.sendBroadcast(it);

NFC、位置情報、ソフトキーボード、APN の設定
NFC

Parameter
Set

TypeSTRING

com.nlscan.action.backuprecovery
APN

Description
Json String

Calling Example:
String json = "{\n" +"\t\"quick_setting\": [{\n" +"\t\t\"quick_setting\": [{\n" +"\t\t\t\"NFC.Enable\": \"1\"\n" +"\t\t}],\n" +"\t\t\"set_data_diff_flag\": \"0\"\n" +"\t}],\n" +"\t\"version\": \"V0.00.001\"\n" +"}";
String action = "com.nlscan.action.backuprecovery";String pkg = "com.nlscan.nlsbackuprecovery";Intent intent = new Intent(action);
intent.setPackage(pkg);
intent.putExtra("set", json);
sendBroadcast(intent);

Json Explanation
NFC:{"quick_setting": [{9"quick_setting": [{"NFC.Enable": "1"}],
"set_data_diff_flag": "1"//1：Enable 0：Disable}],"version": "V0.00.001"}

Soft Keyboard:{"quick_setting": [{"quick_setting": [{"SHOWSOFTINPUT.Enable": "1"}],
"set_data_diff_flag": "1"}],"version": "V0.00.001"}

Positioning:{"device_setting": [{"start_intent": [{"Intent.list": [{"type": "broadcast",

10//1：Enable 0：Disable

"action": "nlscan.action.WRITE_SETTINGS_DB","group_split_char":";","params":"es-db-secure;es-name-location_providers_allowed;es-value+network,gps;es-type-string"}]}],"set_data_diff_flag": "1"}]"version": "V0.00.001"}

APN:{"device_setting": [{"apn": [{"RESET_APN.Enable": "1","APN_LIST.list": [{"APN_PROXY": "","APN_TYPE": "","APN_SUBID": "1",//proxy//type//SIM card id, "0" or "1" for single SIM

card"APN_MVNO_TYPE": "", //MVNO Type
"APN_MMSC": "",//MMSC"APN_MVNO_VALUE": "", //MVNO Value"APN_AUTHTYPE": "",// Auth type, optional value:
PAP,CHAP,PAP OR CHAP
"APN_SERVER": "","APN_APN": "11111","APN_USER": "","APN_PROTOCOL": "IPv4/IPv6",
IPv6，IPv4/IPv6

11//Server//APN//User Name//Protocol, optional value：IPv4，

"APN_NAME": "11111",//APN name
"APN_PASSWORD": "",//Password"APN_PORT": "",//Port"APN_OPERTYPE": "2", // Do not change this item
"APN_MMSPROXY": "",//MMS proxy"APN_ROAMING_PROTOCOL": "IPv4/IPv6", // Roaming protocol，optional value：IPv4，IPv6，IPv4/IPv6"APN_MMSPORT": "",//MMS port
"APN_BEARER": ""//Bearer system}]}],"set_data_diff_flag": "1"}],"version": "V0.00.001"}

APN 設定の注意事項：端末に手動で APN を追加し、機能が正常であることを確認した後、新たに追加された APN の詳細パラメータインターフェースに従って json パラメータを完成させます。
上記の json は、次のように個別に、または一度に組み合わせて設定できます:{"device_setting": [{"start_intent": [{"Intent.list": [{"type": "broadcast","action": "nlscan.action.WRITE_SETTINGS_DB","group_split_char":";","params":"es-db-secure;es-name-location_providers_allowed;es-value+network,gps;es-type-string"}
]

12

}
],
"apn": [{"RESET_APN.Enable": "1","APN_LIST.list": [{"APN_PROXY": "","APN_TYPE": "","APN_SUBID": "1","APN_MVNO_TYPE": "","APN_MMSC": "","APN_MVNO_VALUE": "","APN_AUTHTYPE": "","APN_SERVER": "","APN_APN": "11111","APN_USER": "","APN_PROTOCOL": "IPv4/IPv6","APN_NAME": "11111","APN_PASSWORD": "","APN_PORT": "","APN_OPERTYPE": "2","APN_MMSPROXY": "","APN_ROAMING_PROTOCOL": "IPv4/IPv6","APN_MMSPORT": "","APN_BEARER": ""}]}],"set_data_diff_flag": "1"}],"quick_setting": [{"quick_setting": [{"NFC.Enable": "1","SHOWSOFTINPUT.Enable": "1"}13

],
"set_data_diff_flag": "1"}],"version": "V0.00.001"}

14最近使用したアプリの有効または無効
nlscan.action.SWITCH_RECENTSExample:
Intent intent = new Intent("nlscan.action.SWITCH_RECENTS");intent.putExtra("ENABLE", false); //Disable the recent apps
context.sendBroadcast(intent);

15備考
Symbology ID Number
ID Number
01234567891011121314151617181920212223232425
2627282930

Symbology
ZASETUPSETUP128
CODE128
UCCEAN128
AIM128
GS1_128
ISBT128
EAN8
EAN13
UPCE
UPCA
ISBN
ISSN
CODE39CODE9393I
CODABAR
ITF
ITF6
ITF14
DPLEITCODE
DPIDENTCODECHNPOST25
STANDARD25
IATA25
MATRIX25
INDUSTRIAL25
COOP25
CODE11MSIPLESSEYPLESSEYRSS1416313233343536373839404142434445256257258259260261262263264265266267268269270271272273274275512513514515

RSSLIMITEDRSSEXPANDEDTELEPEN
CHANNELCODE
CODE32CODEZ
CODABLOCKF
CODABLOCKA
CODE49CODE16K
HIBC128
HIBC39RSSFAMILY
TriopticCODE39
UPC_E1
PDF417
MICROPDFQRCODEMICROQRAZTECDATAMATRIXMAXICODECSCODEGRIDMATRIXEARMARKVERICODE
CCA
CCB
CCC
COMPOSITEHIBCAZTHIBCDM
HIBCMICROPDF
HIBCQRDOTCODEPOSTNETONECODE
RM4SCCPLANET

17516
517
518
519
520
768
769
770
2048
2049
65535

KIX
APCUSTOM
APREDIRECT
APREPLYPAIDAPROUTING
NUMOCRBPASSPORTTD1
PRIVATEZZCODEUNKNOWN

1819