Listeners provided by Zabaan
Zabaan provides developers with 2 interfaces.
Assistant State interface
You can listen to state changes of ZabaanAssistant by implementing AssistantStateListener
. To use this listener you will need to implement this interface in your activity class and use Zabaan.getInstance().setAssistantStateListener(<YourActivity>.this)
method.
This interface provides the following callbacks to the implementor :
assistantAvailable()
assistantClicked()
assistantLanguageNotSupported()
Assistant Interaction Interface
You can listen to audio events of by implementingAssistantInteractionListener
.
To use this listener you will have to implement this interface in your activity class and use Zabaan.getInstance().setAssistantInteractionListener(<YourActivity>.this)
This interface provides the following callbacks to you:
assistantSpeechDataDownloaded(ZabaanLanguages language)
assistantSpeechDataDownloadError()
assistantSpeechStart(ZabaanSpeakable)
assistantSpeechEnd(ZabaanSpeakable)
assistantSpeechError(ZabaanSpeakable)
ZabaanSpeakable
- This object contains metadata relavent to the current interaction. You can retrieve any of the fields below by using the appropriate getter method (e.g.. getIndex()
).
int index; //index of sentence in interaction set
int viewId; //view id of view highlighted for interaction
String state; //state passed to trigger interaction