[ Web Proxy ]
URL:
Viewing: https://developer.android.com/reference/android/speech/ModelDownloadListener [Back]  [Original]

ModelDownloadListener  |  API reference  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]
Stay organized with collections Save and categorize content based on your preferences.
Added in API level 34

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 RecognitionService only if the download has started after the request.

abstract void onScheduled()

Called when RecognitionService scheduled the download, but won't satisfy it immediately.

abstract void onSuccess()

This method is called:

  • if the model is already available;
  • if the RecognitionService has started and completed the download.

  • Public methods

    onError

    Added in API level 34
    public abstract void onError (int error)

    A network or scheduling error occurred.

    Parameters
    error int: code is defined in SpeechRecognizer
    Value is one of the following:

    onProgress

    Added in API level 34
    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

    Added in API level 34
    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

    Added in API level 34
    public abstract void onSuccess ()

    This method is called:

  • if the model is already available;
  • if the RecognitionService has started and completed the download.

    Once this method is called, the model can be safely used to satisfy recognition requests.

  • Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

    Last updated 2026-08-03 UTC.

    [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-03 UTC."],[],[]]

    Web Proxy Viewer  |  New URL  |  Original Page