DownloadConditions.Builder
Stay organized with collections
Save and categorize content based on your preferences.
Public Constructor Summary
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Methods
Sets that a device must be charging for downloading to occur.
Only works on Android N and above.
Sets that a device must use wifi for downloading to occur.
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 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eDownloadConditions.Builder\u003c/code\u003e helps create \u003ccode\u003eDownloadConditions\u003c/code\u003e objects, which specify requirements for downloading machine learning models.\u003c/p\u003e\n"],["\u003cp\u003eYou can specify that downloads only occur when the device is charging and/or connected to Wi-Fi.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild()\u003c/code\u003e method creates an immutable \u003ccode\u003eDownloadConditions\u003c/code\u003e instance based on the builder's settings.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003erequireCharging()\u003c/code\u003e only functions on Android N and above.\u003c/p\u003e\n"]]],[],null,["# DownloadConditions.Builder\n\npublic static class **DownloadConditions.Builder** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nBuilder of [DownloadConditions](/android/reference/com/google/mlkit/common/model/DownloadConditions). \n\n### Public Constructor Summary\n\n|---|----------------------------------------------------------------------------------------------------|\n| | [Builder](/android/reference/com/google/mlkit/common/model/DownloadConditions.Builder#Builder())() |\n\n### Public Method Summary\n\n|-----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [DownloadConditions](/android/reference/com/google/mlkit/common/model/DownloadConditions) | [build](/android/reference/com/google/mlkit/common/model/DownloadConditions.Builder#build())() Builds [DownloadConditions](/android/reference/com/google/mlkit/common/model/DownloadConditions). |\n| [DownloadConditions.Builder](/android/reference/com/google/mlkit/common/model/DownloadConditions.Builder) | [requireCharging](/android/reference/com/google/mlkit/common/model/DownloadConditions.Builder#requireCharging())() Sets that a device must be charging for downloading to occur. |\n| [DownloadConditions.Builder](/android/reference/com/google/mlkit/common/model/DownloadConditions.Builder) | [requireWifi](/android/reference/com/google/mlkit/common/model/DownloadConditions.Builder#requireWifi())() Sets that a device must use wifi for downloading to occur. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public **Builder** ()\n\nPublic Methods\n--------------\n\n#### public [DownloadConditions](/android/reference/com/google/mlkit/common/model/DownloadConditions)\n**build** ()\n\nBuilds [DownloadConditions](/android/reference/com/google/mlkit/common/model/DownloadConditions). \n\n#### public [DownloadConditions.Builder](/android/reference/com/google/mlkit/common/model/DownloadConditions.Builder)\n**requireCharging** ()\n\nSets that a device must be charging for downloading to occur.\n\nOnly works on Android N and above. \n\n#### public [DownloadConditions.Builder](/android/reference/com/google/mlkit/common/model/DownloadConditions.Builder)\n**requireWifi** ()\n\nSets that a device must use wifi for downloading to occur."]]