Share via


SimPhonebookContract.SimRecords.GetEncodedNameLength Method

Definition

Returns the number of bytes required to encode the specified name when it is stored on the SIM.

[Android.Runtime.Register("getEncodedNameLength", "(Landroid/content/ContentResolver;Ljava/lang/String;)I", "", ApiSince=31)]
public static int GetEncodedNameLength (Android.Content.ContentResolver resolver, string name);
[<Android.Runtime.Register("getEncodedNameLength", "(Landroid/content/ContentResolver;Ljava/lang/String;)I", "", ApiSince=31)>]
static member GetEncodedNameLength : Android.Content.ContentResolver * string -> int

Parameters

resolver
ContentResolver
name
String

Returns

the number of bytes required by the encoded name or #ERROR_NAME_UNSUPPORTED if the name could not be encoded.

Attributes

Remarks

Returns the number of bytes required to encode the specified name when it is stored on the SIM.

ElementaryFiles#NAME_MAX_LENGTH is specified in bytes but the encoded name may require more than 1 byte per character depending on the characters it contains. So this method can be used to check whether a name exceeds the max length.

Java documentation for android.provider.SimPhonebookContract.SimRecords.getEncodedNameLength(android.content.ContentResolver, java.lang.String).

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