# AndroidCharacter

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/android/text/AndroidCharacter#constants)\|[Ctors](https://developer.android.com/reference/android/text/AndroidCharacter#pubctors)\|[Methods](https://developer.android.com/reference/android/text/AndroidCharacter#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/text/AndroidCharacter#inhmethods)  

# AndroidCharacter

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/text/AndroidCharacter "View this page in Kotlin")\|Java

`
public


class
AndroidCharacter
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|-------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.text.AndroidCharacter |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 26.**   
Use various methods from[UCharacter](https://developer.android.com/reference/android/icu/lang/UCharacter), instead.

AndroidCharacter exposes some character properties that used to be not easily accessed from java.lang.Character, but are now available in ICU.

## Summary

|                                                                 ### Constants                                                                  ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [EAST_ASIAN_WIDTH_AMBIGUOUS](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_AMBIGUOUS) <br />   |
| `int` | [EAST_ASIAN_WIDTH_FULL_WIDTH](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_FULL_WIDTH) <br /> |
| `int` | [EAST_ASIAN_WIDTH_HALF_WIDTH](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_HALF_WIDTH) <br /> |
| `int` | [EAST_ASIAN_WIDTH_NARROW](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_NARROW) <br />         |
| `int` | [EAST_ASIAN_WIDTH_NEUTRAL](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_NEUTRAL) <br />       |
| `int` | [EAST_ASIAN_WIDTH_WIDE](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_WIDE) <br />             |

|                                                 ### Public constructors                                                 ||
|----------------------------------------------------------------------------------------------------------------------|---|
| ` `[AndroidCharacter](https://developer.android.com/reference/android/text/AndroidCharacter#AndroidCharacter())`() ` |

|                                                                                                                                                       ### Public methods                                                                                                                                                        ||
|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static void`    | ` `[getDirectionalities](https://developer.android.com/reference/android/text/AndroidCharacter#getDirectionalities(char[],%20byte[],%20int))`(char[] src, byte[] dest, int count) ` Fill in the first`count`bytes of`dest`with the directionalities from the first`count`chars of`src`.                      |
| ` static int`     | ` `[getEastAsianWidth](https://developer.android.com/reference/android/text/AndroidCharacter#getEastAsianWidth(char))`(char input) ` Calculate the East Asian Width of a character according to[Unicode TR#11](http://unicode.org/reports/tr11/).                                                            |
| ` static void`    | ` `[getEastAsianWidths](https://developer.android.com/reference/android/text/AndroidCharacter#getEastAsianWidths(char[],%20int,%20int,%20byte[]))`(char[] src, int start, int count, byte[] dest) ` Fill the first`count`bytes of`dest`with the East Asian Width from`count`chars of`src`starting at`start`. |
| ` static char`    | ` `[getMirror](https://developer.android.com/reference/android/text/AndroidCharacter#getMirror(char))`(char ch) ` Return the right-to-left mirror (or the original char if none) of the specified char.                                                                                                      |
| ` static boolean` | ` `[mirror](https://developer.android.com/reference/android/text/AndroidCharacter#mirror(char[],%20int,%20int))`(char[] text, int start, int count) ` Replace the specified slice of`text`with the chars' right-to-left mirrors (if any), returning true if any replacements were made.                      |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### EAST_ASIAN_WIDTH_AMBIGUOUS

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int EAST_ASIAN_WIDTH_AMBIGUOUS
```

<br />

<br />

Constant Value: 1 (0x00000001)  

### EAST_ASIAN_WIDTH_FULL_WIDTH

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int EAST_ASIAN_WIDTH_FULL_WIDTH
```

<br />

<br />

Constant Value: 3 (0x00000003)  

### EAST_ASIAN_WIDTH_HALF_WIDTH

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int EAST_ASIAN_WIDTH_HALF_WIDTH
```

<br />

<br />

Constant Value: 2 (0x00000002)  

### EAST_ASIAN_WIDTH_NARROW

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int EAST_ASIAN_WIDTH_NARROW
```

<br />

<br />

Constant Value: 4 (0x00000004)  

### EAST_ASIAN_WIDTH_NEUTRAL

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int EAST_ASIAN_WIDTH_NEUTRAL
```

<br />

<br />

Constant Value: 0 (0x00000000)  

### EAST_ASIAN_WIDTH_WIDE

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int EAST_ASIAN_WIDTH_WIDE
```

<br />

<br />

Constant Value: 5 (0x00000005)

## Public constructors

### AndroidCharacter

```
public AndroidCharacter ()
```

<br />

<br />

## Public methods

### getDirectionalities

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static void getDirectionalities (char[] src, 
                byte[] dest, 
                int count)
```

Fill in the first`count`bytes of`dest`with the directionalities from the first`count`chars of`src`. This is just like Character.getDirectionality() except it is a batch operation.

<br />

|       Parameters       ||
|---------|---------------|
| `src`   | `char` <br /> |
| `dest`  | `byte` <br /> |
| `count` | `int` <br />  |

### getEastAsianWidth

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static int getEastAsianWidth (char input)
```

Calculate the East Asian Width of a character according to[Unicode TR#11](http://unicode.org/reports/tr11/). The return will be one of[EAST_ASIAN_WIDTH_NEUTRAL](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_NEUTRAL),[EAST_ASIAN_WIDTH_AMBIGUOUS](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_AMBIGUOUS),[EAST_ASIAN_WIDTH_HALF_WIDTH](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_HALF_WIDTH),[EAST_ASIAN_WIDTH_FULL_WIDTH](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_FULL_WIDTH),[EAST_ASIAN_WIDTH_NARROW](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_NARROW), or[EAST_ASIAN_WIDTH_WIDE](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_WIDE).

<br />

|                    Parameters                    ||
|---------|-----------------------------------------|
| `input` | `char`: the character to measure <br /> |

|                   Returns                    ||
|-------|---------------------------------------|
| `int` | the East Asian Width for input <br /> |

### getEastAsianWidths

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static void getEastAsianWidths (char[] src, 
                int start, 
                int count, 
                byte[] dest)
```

Fill the first`count`bytes of`dest`with the East Asian Width from`count`chars of`src`starting at`start`. East Asian Width is calculated based on[Unicode TR#11](http://unicode.org/reports/tr11/). Each entry in`dest`will be one of[EAST_ASIAN_WIDTH_NEUTRAL](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_NEUTRAL),[EAST_ASIAN_WIDTH_AMBIGUOUS](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_AMBIGUOUS),[EAST_ASIAN_WIDTH_HALF_WIDTH](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_HALF_WIDTH),[EAST_ASIAN_WIDTH_FULL_WIDTH](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_FULL_WIDTH),[EAST_ASIAN_WIDTH_NARROW](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_NARROW), or[EAST_ASIAN_WIDTH_WIDE](https://developer.android.com/reference/android/text/AndroidCharacter#EAST_ASIAN_WIDTH_WIDE).

<br />

|                               Parameters                                ||
|---------|----------------------------------------------------------------|
| `src`   | `char`: character array of input to measure <br />             |
| `start` | `int`: first character in array to measure <br />              |
| `count` | `int`: maximum number of characters to measure <br />          |
| `dest`  | `byte`: byte array of results for each character in src <br /> |

### getMirror

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static char getMirror (char ch)
```

Return the right-to-left mirror (or the original char if none) of the specified char.

<br />

|     Parameters      ||
|------|---------------|
| `ch` | `char` <br /> |

|    Returns     ||
|--------|--------|
| `char` | <br /> |

### mirror

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static boolean mirror (char[] text, 
                int start, 
                int count)
```

Replace the specified slice of`text`with the chars' right-to-left mirrors (if any), returning true if any replacements were made.

<br />

|                              Parameters                               ||
|---------|--------------------------------------------------------------|
| `text`  | `char`: array of characters to apply mirror operation <br /> |
| `start` | `int`: first character in array to mirror <br />             |
| `count` | `int`: maximum number of characters to mirror <br />         |

|                     Returns                      ||
|-----------|---------------------------------------|
| `boolean` | true if replacements were made <br /> |