Socket ScanAPI Reference
}
5.6 Decoded data notification
Each time a scanner decodes correctly a barcode, ScanAPI Helper calls the
onDecodedData notification with the device information object and the decoded
data. In the Scanner Settings for Android case the activity that has registered for the
NOTIFY_DATA_ARRIVAL intent will receive and display the decoded data. This
activity is the ScanWindowActivity.
Here is the code extract from Android Scanner Settings for this notification:
/**
* ScanAPI is delivering some decoded data
* as the activity to display them
*/
public void
}
The BlackBerry version of Scanner Settings onDecodedData looks like this:
public void
_scanwindow.DoScannedData(decodedData.getData(),decodedData.getSymbologyName());
}
5.7 Scanner removal
When a scanner disconnects from the host, the ScanAPI Helper notifies the
application by calling the notification onDeviceRemoval. Usually the application
updates its UI to reflect that change. The Scanner Settings for Android sends an
Intent to the Activity that has registered for it, as shown in the following lines:
/**
* a device has disconnected. Update the UI accordingly
*/
public void
Intent
intent=new
Intent(NOTIFY_SCANNER_REMOVAL);
intent.putExtra(EXTRA_DEVICENAME,deviceRemoved.getName());
sendBroadcast(intent);
}
The BlackBerry Scanner Settings version does something similar:
© 2013 Socket Mobile, Inc.
intent.putExtra(EXTRA_ERROR_MESSAGE,text);
}
sendBroadcast(intent);
onDecodedData(DeviceInfo deviceInfo,
ISktScanDecodedData decodedData) {
Intent
intent=new
Intent(NOTIFY_DATA_ARRIVAL);
intent.putExtra(EXTRA_SYMBOLOGY_NAME,decodedData.getSymbologyName());
intent.putExtra(EXTRA_DECODEDDATA,decodedData.getData());
sendBroadcast(intent);
onDecodedData(DeviceInfo deviceInfo,
ISktScanDecodedData decodedData) {
if(_scanwindow!=null)
onDeviceRemoval(DeviceInfo deviceRemoved) {
_currentSelectedDevice=null;
33/152
Need help?
Do you have a question about the ScanAPI and is the answer not in the manual?