Udostępnij za pośrednictwem


TranslationManager.GetOnDeviceTranslationCapabilities(Int32, Int32) Method

Definition

Returns a set of TranslationCapabilitys describing the capabilities for on-device Translators.

[Android.Runtime.Register("getOnDeviceTranslationCapabilities", "(II)Ljava/util/Set;", "", ApiSince=31)]
public System.Collections.Generic.ICollection<Android.Views.Translation.TranslationCapability> GetOnDeviceTranslationCapabilities (int sourceFormat, int targetFormat);
[<Android.Runtime.Register("getOnDeviceTranslationCapabilities", "(II)Ljava/util/Set;", "", ApiSince=31)>]
member this.GetOnDeviceTranslationCapabilities : int * int -> System.Collections.Generic.ICollection<Android.Views.Translation.TranslationCapability>

Parameters

sourceFormat
Int32

data format for the input data to be translated.

targetFormat
Int32

data format for the expected translated output data.

Returns

A set of TranslationCapabilitys.

Attributes

Remarks

Returns a set of TranslationCapabilitys describing the capabilities for on-device Translators.

These translation capabilities contains a source and target TranslationSpec representing the data expected for both ends of translation process. The capabilities provides the information and limitations for generating a TranslationContext. The context object can then be used by #createOnDeviceTranslator(TranslationContext, Executor, Consumer) to obtain a Translator for translations.

<strong>NOTE: </strong>Call on a worker thread.

Java documentation for android.view.translation.TranslationManager.getOnDeviceTranslationCapabilities(int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to