DownloadCallback
Stay organized with collections
Save and categorize content based on your preferences.
Callback functions used for feature downloading.
Public Method Summary
void |
|
void |
|
void |
onDownloadProgress(long totalBytesDownloaded)
Called when the feature download is in progress.
|
void |
onDownloadStarted(long bytesToDownload)
Called when the feature download started properly.
|
Public Methods
public void onDownloadCompleted ()
Called when the feature download is completed.
public void onDownloadFailed (GenAiException
e)
Called when the feature download failed.
public void onDownloadProgress (long
totalBytesDownloaded)
Called when the feature download is in progress.
public void onDownloadStarted (long
bytesToDownload)
Called when the feature download started properly.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-14 UTC.
[null,null,["Last updated 2025-05-14 UTC."],[],[],null,["# DownloadCallback\n\npublic interface **DownloadCallback** \nCallback functions used for feature downloading. \n\n### Public Method Summary\n\n|------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| void | [onDownloadCompleted](/android/reference/com/google/mlkit/genai/common/DownloadCallback#onDownloadCompleted())() Called when the feature download is completed. |\n| void | [onDownloadFailed](/android/reference/com/google/mlkit/genai/common/DownloadCallback#onDownloadFailed(com.google.mlkit.genai.common.GenAiException))([GenAiException](/android/reference/com/google/mlkit/genai/common/GenAiException) e) Called when the feature download failed. |\n| void | [onDownloadProgress](/android/reference/com/google/mlkit/genai/common/DownloadCallback#onDownloadProgress(long))(long totalBytesDownloaded) Called when the feature download is in progress. |\n| void | [onDownloadStarted](/android/reference/com/google/mlkit/genai/common/DownloadCallback#onDownloadStarted(long))(long bytesToDownload) Called when the feature download started properly. |\n\nPublic Methods\n--------------\n\n#### public void **onDownloadCompleted** ()\n\nCalled when the feature download is completed. \n\n#### public void **onDownloadFailed** ([GenAiException](/android/reference/com/google/mlkit/genai/common/GenAiException) e)\n\nCalled when the feature download failed. \n\n#### public void **onDownloadProgress** (long totalBytesDownloaded)\n\nCalled when the feature download is in progress. \n\n#### public void **onDownloadStarted** (long bytesToDownload)\n\nCalled when the feature download started properly."]]