Table of Contents About This Manual ............................. 1 Development Environment ..........................1 Obtain Product Model Number ......................... 1 Barcode Scanner ..............................1 Scan Barcode ..............................1 Get Barcode Data ............................2 Stop Scanning ............................... 3 Change the Scanner Settings ........................3 Reserved Keys ..............................
About This Manual This manual is applicable to NLS-MT90 portable data collectors (hereinafter referred to as “the MT90” or “the terminal”). Development Environment All APIs are built based on standard Android broadcast mechanism, so there is no need for additional SDKs.
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); Note: When a scan and decode session is in progress, sending the broadcast above will stop the ongoing session.
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"); 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 Stop Scanning Use the broadcast nlscan.action.STOP_SCAN to stop an ongoing decode session.
= 2 Pulse mode* Value = 1 Fill in EditText directly* EXTRA_SCAN_MODE = 2 Simulate keystroke = 3 Output via API Value = 0 Do not add a line feed* EXTRA_SCAN_AUTOENT = 1 Add a line feed Value = 0 Sound notification off EXTRA_SCAN_NOTY_SND = 1 Sound notification on* Value = 0 Vibration notification off*...
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; return super.onKeyDown(keyCode, event); Other APIs Expand the Status Bar To set the status bar to be expandable/not expandable, application should send to the system the broadcast nlscan.action.STATUSBAR_SWITCH_STATE with the value of Extra parameter ENABLE set to be true/false.
Page 9
Example: public long getTimeMillis(){ Calendar c = Calendar.getInstance(); c.set(2016, 0, 1, 0,0,0); return c.getTimeInMillis(); Intent it = new Intent("nlscan.action.SET_TIME"); long mills = getTimeMillis(); it.putExtra("TIME_MS", String.valueOf(mills)); mContext.sendBroadcast(it);...