Socket ScanAPI Reference
The recommended way to integrate ScanAPI in your Xcode project is to drag and
drop the ScanAPI folder located at the root of the ScanAPI SDK into your Xcode
project.
The application must add the External accessory framework, and in the info plist the
"Supported External Accessory Protocol" should contains the string
"com.socketmobile.chs".
Most of the time, ScanApiHelper should be integrated into one of the controller of
the iOS application. The header of this controller should contains the following line:
#import "ScanApiHelper.h"
The controller must derive from ScanApiHelperDelegate protocol.
7
Recommendations
7.1 General
The recommended approach of managing a scanner connection to the host is to
detect if a scanner is connected when needed in the application. It is not
recommended to control the connection and disconnection of the scanner as the
scanner can be disconnected or connected independently of the application state.
If an application has multiple views, but only one view requires a scanner to be
connected, the best approach for this view is to check if a scanner is connected. If a
scanner is not connected, then the application should direct the user on how to
connect the scanner to the host. This can be done by scanning a barcode, or simply
by turning on a scanner that is already paired to the host. The scanner can be left
connected through the life cycle of the application knowing that the power
consumption for both, the host and the scanner, is minimal in that operational
mode.
If the scanner doesn't have any activity, it will shut itself down after a 2 hours
timeout. If for some reason, the host and the scanner are out of range, the scanner
will automatically try to reconnect to the host during a period of 45 seconds for a
CHS 7x series or up to 30 connection attempts for a CHS 7(E,M,P) series.
At any time the user can turn off or on the scanner. Upon turning the scanner back
one, it will reconnect automatically to the last paired host device.
7.2 Android
It is not recommended to attach ScanAPI or ScanApiHelper to the Activity class, as
this object will get destroy and re-created upon screen rotation causing a connection
© 2013 Socket Mobile, Inc.
37/152
Need help?
Do you have a question about the ScanAPI and is the answer not in the manual?