Socket ScanAPI Reference
19.5.2
Return value
This method returns SktScanApiOwnership.Error.kNotRegistered if the application
hasn't registered before calling this method, or
SktScanApiOwnership.Error.kNoError in case of success.
19.5.3
Remarks
When an application receives a ScanAPI ownership notification indicating it can now
take the ownership of ScanAPI, it must call this method in order to claim the
ScanAPI ownership prior opening ScanAPI.
19.5.4
Example
/**
* open ScanAPI by first claiming its ownership
* then checking if the previous instance of ScanAPI has
* been correctly close. ScanAPI initialization is done in a
* separate thread, because it performs some internal testing
* that requires some time to complete and we want the UI to be
* responsive and present on the screen during that time.
*/
private void
openScanApi(){
_scanApiOwnership.claimOwnership();
// check this event to be sure the previous
// ScanAPI consumer has been shutdown
Debug.MSG(Debug.kLevelTrace,"Wait for the previous terminate event to be
if(_consumerTerminatedEvent.waitFor(3000)==true){
set");
}
else{
set");
the previous close hasn't been completed. Restart this
}
}
19.5.5
Function information
C/C++
Header
Import library
Minimum operating systems
© 2013 Socket Mobile, Inc.
Debug.MSG(Debug.kLevelTrace,"the previous terminate event has been
_consumerTerminatedEvent.reset();
_scanApiHelper.removeCommands(null);// remove all the commands
_scanApiHelper.open();
Debug.MSG(Debug.kLevelTrace,"the previous terminate event has NOT been
Intent
intent=new
Intent(NOTIFY_ERROR_MESSAGE);
intent.putExtra(EXTRA_ERROR_MESSAGE,"Unable to start ScanAPI because
sendBroadcast(intent);
Not available
Not available
Not available
application.");
set");
145/152
Need help?
Do you have a question about the ScanAPI and is the answer not in the manual?