ModelDownloadListener
public
interface
ModelDownloadListener
android.speech.ModelDownloadListener |
Listener for model download events. It makes RecognitionService
let callers know about
the progress of model download for a single recognition request.
Summary
Public methods | |
---|---|
abstract
void
|
onError(int error)
A network or scheduling error occurred. |
abstract
void
|
onProgress(int completedPercent)
Called by |
abstract
void
|
onScheduled()
Called when |
abstract
void
|
onSuccess()
This method is called: RecognitionService has started and completed the download.
|
Public methods
onError
public abstract void onError (int error)
A network or scheduling error occurred.
onProgress
public abstract void onProgress (int completedPercent)
Called by RecognitionService
only if the download has started after the request.
The number of calls to this method varies depending of the RecognitionService
implementation. If the download finished quickly enough, onSuccess()
may be called
directly. In other cases, this method may be called any number of times during the download.
Parameters | |
---|---|
completedPercent |
int : the percentage of download that is completed |
onScheduled
public abstract void onScheduled ()
Called when RecognitionService
scheduled the download, but won't satisfy it
immediately. There will be no further updates on this listener.
onSuccess
public abstract void onSuccess ()
This method is called:
RecognitionService
has started and completed the download.
Once this method is called, the model can be safely used to satisfy recognition requests.