Socket ScanAPI Reference
drop of the eventual connected scanner. The scanner will automatically reconnect to
the host in this case, but the user experience won't be ideal.
We recommend attaching ScanAPI or ScanApiHelper to the application class as
shown in our sample application ScannerSettings for the optimal user experience.
It is important to note that your application must request the permission to use
Bluetooth and to write in the external storage. This last permission is required
because the ScanAPI settings are stored into a file on the external storage.
These permissions are identified respectively as follow:
android.permission.BLUETOOTH,
android.permission.BLUETOOTH_ADMIN and
android.permission.WRITE_EXTERNAL_STORAGE.
If these permissions aren't requested, the external storage will make ScanAPI
returning error ESKT_TESTFAILED (-1), and the Bluetooth one will make ScanAPI
returning error ESKT_UNABLEOPENDEVICE (-27) and then
ESKT_NOTHINGTOLISTEN (-47).
7.3 iOS
On an iOS device, the scanner will always stay connected to the host. If the
application goes to the background, the application is paused. The External
Accessory framework will then simulate a device disconnection to the application,
but the Bluetooth link remains active. When the application is brought back to the
foreground, the External Accessory framework simulates a device connection. Only
certain application types are authorized to run while in background. For these types
of applications, the connection to the scanner will stay alive and running. The
application types are multi-media (music applications playing music while moved to
the background), VOIP applications and location based applications. This restriction
is dictated by iOS and is out of the control of ScanAPI.
8 Device Connection and Disconnection process
With this Version 3 of CHS, in order to have the best user experience possible, the
CHS is always the initiator of the connection process. That is, the CHS will always be
the device to start the connection process, after an initial setup connection has been
made.
8.1 Initial Connection
The process of the initial connection starts by having the CHS scan a connect
barcode. Once the Bluetooth pairing process is completed, the ScanAPI object
generates a Device Arrival notification that contains the device information.
© 2013 Socket Mobile, Inc.
38/152
Need help?
Do you have a question about the ScanAPI and is the answer not in the manual?