RecognitionSupport.Builder


public static final class RecognitionSupport.Builder
extends Object

java.lang.Object
   ↳ android.speech.RecognitionSupport.Builder


A builder for RecognitionSupport

Summary

Public constructors

Builder()

Public methods

RecognitionSupport.Builder addInstalledOnDeviceLanguage(String value)
RecognitionSupport.Builder addOnlineLanguage(String value)
RecognitionSupport.Builder addPendingOnDeviceLanguage(String value)
RecognitionSupport.Builder addSupportedOnDeviceLanguage(String value)
RecognitionSupport build()

Builds the instance.

RecognitionSupport.Builder setInstalledOnDeviceLanguages(List<String> value)

Support for this request is ready for use on this device for the returned languages.

RecognitionSupport.Builder setOnlineLanguages(List<String> value)

Support for this request is available via a remote implementation.

RecognitionSupport.Builder setPendingOnDeviceLanguages(List<String> value)

Support for this request is scheduled for download for the returned languages.

RecognitionSupport.Builder setSupportedOnDeviceLanguages(List<String> value)

These languages are supported but need to be downloaded before use.

Inherited methods

Public constructors

Builder

Added in API level 33
public Builder ()

Public methods

addInstalledOnDeviceLanguage

Added in API level 33
public RecognitionSupport.Builder addInstalledOnDeviceLanguage (String value)

Parameters
value String: This value cannot be null.

Returns
RecognitionSupport.Builder This value cannot be null.

addOnlineLanguage

Added in API level 33
public RecognitionSupport.Builder addOnlineLanguage (String value)

Parameters
value String: This value cannot be null.

Returns
RecognitionSupport.Builder This value cannot be null.

addPendingOnDeviceLanguage

Added in API level 33
public RecognitionSupport.Builder addPendingOnDeviceLanguage (String value)

Parameters
value String: This value cannot be null.

Returns
RecognitionSupport.Builder This value cannot be null.

addSupportedOnDeviceLanguage

Added in API level 33
public RecognitionSupport.Builder addSupportedOnDeviceLanguage (String value)

Parameters
value String: This value cannot be null.

Returns
RecognitionSupport.Builder This value cannot be null.

build

Added in API level 33
public RecognitionSupport build ()

Builds the instance. This builder should not be touched after calling this!

Returns
RecognitionSupport This value cannot be null.

setInstalledOnDeviceLanguages

Added in API level 33
public RecognitionSupport.Builder setInstalledOnDeviceLanguages (List<String> value)

Support for this request is ready for use on this device for the returned languages.

Parameters
value List: This value cannot be null.

Returns
RecognitionSupport.Builder This value cannot be null.

setOnlineLanguages

Added in API level 33
public RecognitionSupport.Builder setOnlineLanguages (List<String> value)

Support for this request is available via a remote implementation. SpeechRecognizer created via SpeechRecognizer#createOnDeviceSpeechRecognizer(Context) are expected to return an empty list.

Parameters
value List: This value cannot be null.

Returns
RecognitionSupport.Builder This value cannot be null.

setPendingOnDeviceLanguages

Added in API level 33
public RecognitionSupport.Builder setPendingOnDeviceLanguages (List<String> value)

Support for this request is scheduled for download for the returned languages.

Parameters
value List: This value cannot be null.

Returns
RecognitionSupport.Builder This value cannot be null.

setSupportedOnDeviceLanguages

Added in API level 33
public RecognitionSupport.Builder setSupportedOnDeviceLanguages (List<String> value)

These languages are supported but need to be downloaded before use. See SpeechRecognizer.triggerModelDownload(android.content.Intent).

Parameters
value List: This value cannot be null.

Returns
RecognitionSupport.Builder This value cannot be null.