Socket ScanAPI Reference
19 SktScanAPIOwnership (available for Java platforms)
Since ScanAPI is single client, meaning only one client application can use ScanAPI at
a time; a SktScanApiOwnership API has been added to help manage the ScanAPI
ownership.
This API is available only on Java platforms (BlackBerry and Android).
When an application needs to use ScanAPI, it uses this SktScanApiOwnership API to
first ask for ScanAPI Ownership. If another application has already the ScanAPI
ownership, it receives a callback asking to release this ownership. Once this release
of ownership is completed, the application requesting it, receives a callback
indicating the ownership has been released and it is now safe for this application to
claim it.
Once an application is done using ScanAPI, it closes it and then releases its
ownership causing any other application to be notified with a SktScanApiOwnership
callback that the ScanAPI ownership has been released and can be re-claimed.
Why it is important to use this SktScanApiOwnership API? If your application works
with other Socket applications such as SocketScan 10 Keyboard wedge, Scanner
Settings or Socket EZ Pair, then this API will prevent any conflict using ScanAPI as
they all use the same SktScanApiOwnership API.
The typical usage of SktScanApiOwnership would be the following:
1) At the application startup, the application constructs the
SktScanApiOwnership object, by giving a notification handler and its
name.
2) The application asks for the ScanAPI ownership and wait for a
response in the SktScanApiOwnership callback.
3) When the response is receive in the ScanApiOwnership callback, the
application claims the ScanAPI ownership and opens ScanAPI.
4) When another application asks for ScanAPI ownership, this current
application receives through its ScanApiOwnership notification
handler an indication it has to close ScanAPI.
5) When ScanAPI is fully closed, this application then releases the
ScanAPI ownership causing the other application to receive a
ScanApiOwnership indicating that the ownership has been released
and therefore it is safe for this application to claim it.
6) When this other application is done using ScanAPI, it closes ScanAPI
and releases its ownership, which causes this current application to
receive a notification indicating it can claim ScanAPI ownership and
reopen it again.
© 2013 Socket Mobile, Inc.
138/152
Need help?
Do you have a question about the ScanAPI and is the answer not in the manual?