# UserDictionary.Words

Added in[API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/android/provider/UserDictionary.Words#constants)\|[Inherited Constants](https://developer.android.com/reference/android/provider/UserDictionary.Words#inhconstants)\|[Fields](https://developer.android.com/reference/android/provider/UserDictionary.Words#lfields)\|[Ctors](https://developer.android.com/reference/android/provider/UserDictionary.Words#pubctors)\|[Methods](https://developer.android.com/reference/android/provider/UserDictionary.Words#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/provider/UserDictionary.Words#inhmethods)  

# UserDictionary.Words

*** ** * ** ***

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

`
public
static


class
UserDictionary.Words
`  
`

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


``


implements

`[BaseColumns](https://developer.android.com/reference/android/provider/BaseColumns)`


`

|---|---------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.provider.UserDictionary.Words |

<br />

*** ** * ** ***

Contains the user defined words.

## Summary

|                                                                                                                                                                                                                                                           ### Constants                                                                                                                                                                                                                                                           ||
|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | [APP_ID](https://developer.android.com/reference/android/provider/UserDictionary.Words#APP_ID) The uid of the application that inserted the word.                                                                                                                                                                                                                                                                                                             |
| [String](https://developer.android.com/reference/java/lang/String) | [CONTENT_ITEM_TYPE](https://developer.android.com/reference/android/provider/UserDictionary.Words#CONTENT_ITEM_TYPE) The MIME type of a[CONTENT_URI](https://developer.android.com/reference/android/provider/UserDictionary.Words#CONTENT_URI)sub-directory of a single word.                                                                                                                                                                                |
| [String](https://developer.android.com/reference/java/lang/String) | [CONTENT_TYPE](https://developer.android.com/reference/android/provider/UserDictionary.Words#CONTENT_TYPE) The MIME type of[CONTENT_URI](https://developer.android.com/reference/android/provider/UserDictionary.Words#CONTENT_URI)providing a directory of words.                                                                                                                                                                                            |
| [String](https://developer.android.com/reference/java/lang/String) | [DEFAULT_SORT_ORDER](https://developer.android.com/reference/android/provider/UserDictionary.Words#DEFAULT_SORT_ORDER) Sort by descending order of frequency.                                                                                                                                                                                                                                                                                                 |
| [String](https://developer.android.com/reference/java/lang/String) | [FREQUENCY](https://developer.android.com/reference/android/provider/UserDictionary.Words#FREQUENCY) The frequency column.                                                                                                                                                                                                                                                                                                                                    |
| [String](https://developer.android.com/reference/java/lang/String) | [LOCALE](https://developer.android.com/reference/android/provider/UserDictionary.Words#LOCALE) The locale that this word belongs to.                                                                                                                                                                                                                                                                                                                          |
| `int`                                                              | [LOCALE_TYPE_ALL](https://developer.android.com/reference/android/provider/UserDictionary.Words#LOCALE_TYPE_ALL) *This constant was deprecated in API level 16. Use[addWord(android.content.Context, java.lang.String, int, java.lang.String, java.util.Locale)](https://developer.android.com/reference/android/provider/UserDictionary.Words#addWord(android.content.Context,%20java.lang.String,%20int,%20java.lang.String,%20java.util.Locale)).*         |
| `int`                                                              | [LOCALE_TYPE_CURRENT](https://developer.android.com/reference/android/provider/UserDictionary.Words#LOCALE_TYPE_CURRENT) *This constant was deprecated in API level 16. Use[addWord(android.content.Context, java.lang.String, int, java.lang.String, java.util.Locale)](https://developer.android.com/reference/android/provider/UserDictionary.Words#addWord(android.content.Context,%20java.lang.String,%20int,%20java.lang.String,%20java.util.Locale)).* |
| [String](https://developer.android.com/reference/java/lang/String) | [SHORTCUT](https://developer.android.com/reference/android/provider/UserDictionary.Words#SHORTCUT) An optional shortcut for this word.                                                                                                                                                                                                                                                                                                                        |
| [String](https://developer.android.com/reference/java/lang/String) | [WORD](https://developer.android.com/reference/android/provider/UserDictionary.Words#WORD) The word column.                                                                                                                                                                                                                                                                                                                                                   |
| [String](https://developer.android.com/reference/java/lang/String) | [_ID](https://developer.android.com/reference/android/provider/UserDictionary.Words#_ID) <br />                                                                                                                                                                                                                                                                                                                                                               |

|                                                                                                                                                                                                                                                                                                                                                ### Inherited constants                                                                                                                                                                                                                                                                                                                                                |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[android.provider.BaseColumns](https://developer.android.com/reference/android/provider/BaseColumns) |--------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------| | [String](https://developer.android.com/reference/java/lang/String) | [_COUNT](https://developer.android.com/reference/android/provider/BaseColumns#_COUNT) The count of rows in a directory. | | [String](https://developer.android.com/reference/java/lang/String) | [_ID](https://developer.android.com/reference/android/provider/BaseColumns#_ID) The unique ID for a row.                | |

|                                                                                                               ### Fields                                                                                                                ||
|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| ` public static final `[Uri](https://developer.android.com/reference/android/net/Uri) | [CONTENT_URI](https://developer.android.com/reference/android/provider/UserDictionary.Words#CONTENT_URI) The content:// style URL for this table |

|                                          ### Public constructors                                          ||
|--------------------------------------------------------------------------------------------------------|---|
| ` `[Words](https://developer.android.com/reference/android/provider/UserDictionary.Words#Words())`() ` |

|                                                                                                                                                                                                                                                                                                                                                         ### Public methods                                                                                                                                                                                                                                                                                                                                                         ||
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static void` | ` `[addWord](https://developer.android.com/reference/android/provider/UserDictionary.Words#addWord(android.content.Context,%20java.lang.String,%20int,%20int))`(`[Context](https://developer.android.com/reference/android/content/Context)` context, `[String](https://developer.android.com/reference/java/lang/String)` word, int frequency, int localeType) ` *This method was deprecated in API level 16. Please use[addWord(android.content.Context, java.lang.String, int, java.lang.String, java.util.Locale)](https://developer.android.com/reference/android/provider/UserDictionary.Words#addWord(android.content.Context,%20java.lang.String,%20int,%20java.lang.String,%20java.util.Locale))instead.* |
| ` static void` | ` `[addWord](https://developer.android.com/reference/android/provider/UserDictionary.Words#addWord(android.content.Context,%20java.lang.String,%20int,%20java.lang.String,%20java.util.Locale))`(`[Context](https://developer.android.com/reference/android/content/Context)` context, `[String](https://developer.android.com/reference/java/lang/String)` word, int frequency, `[String](https://developer.android.com/reference/java/lang/String)` shortcut, `[Locale](https://developer.android.com/reference/java/util/Locale)` locale) ` Adds a word to the dictionary, with the given frequency and the specified locale type.                                                                              |

| ### 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

### APP_ID

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

```
public static final String APP_ID
```

The uid of the application that inserted the word.

TYPE: INTEGER

<br />

<br />

Constant Value: "appid"  

### CONTENT_ITEM_TYPE

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

```
public static final String CONTENT_ITEM_TYPE
```

The MIME type of a[CONTENT_URI](https://developer.android.com/reference/android/provider/UserDictionary.Words#CONTENT_URI)sub-directory of a single word.

<br />

Constant Value: "vnd.android.cursor.item/vnd.google.userword"  

### CONTENT_TYPE

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

```
public static final String CONTENT_TYPE
```

The MIME type of[CONTENT_URI](https://developer.android.com/reference/android/provider/UserDictionary.Words#CONTENT_URI)providing a directory of words.

<br />

Constant Value: "vnd.android.cursor.dir/vnd.google.userword"  

### DEFAULT_SORT_ORDER

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

```
public static final String DEFAULT_SORT_ORDER
```

Sort by descending order of frequency.

<br />

Constant Value: "frequency DESC"  

### FREQUENCY

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

```
public static final String FREQUENCY
```

The frequency column. A value between 1 and 255. Higher values imply higher frequency.

TYPE: INTEGER

<br />

<br />

Constant Value: "frequency"  

### LOCALE

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

```
public static final String LOCALE
```

The locale that this word belongs to. Null if it pertains to all locales. Locale is as defined by the string returned by Locale.toString().

TYPE: TEXT

<br />

<br />

Constant Value: "locale"  

### LOCALE_TYPE_ALL

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

```
public static final int LOCALE_TYPE_ALL
```

<br />

**This constant was deprecated in API level 16.**   
Use[addWord(android.content.Context, java.lang.String, int, java.lang.String, java.util.Locale)](https://developer.android.com/reference/android/provider/UserDictionary.Words#addWord(android.content.Context,%20java.lang.String,%20int,%20java.lang.String,%20java.util.Locale)).

<br />

<br />

Constant Value: 0 (0x00000000)  

### LOCALE_TYPE_CURRENT

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

```
public static final int LOCALE_TYPE_CURRENT
```

<br />

**This constant was deprecated in API level 16.**   
Use[addWord(android.content.Context, java.lang.String, int, java.lang.String, java.util.Locale)](https://developer.android.com/reference/android/provider/UserDictionary.Words#addWord(android.content.Context,%20java.lang.String,%20int,%20java.lang.String,%20java.util.Locale)).

<br />

<br />

Constant Value: 1 (0x00000001)  

### SHORTCUT

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

```
public static final String SHORTCUT
```

An optional shortcut for this word. When the shortcut is typed, supporting IMEs should suggest the word in this row as an alternate spelling too.

<br />

Constant Value: "shortcut"  

### WORD

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

```
public static final String WORD
```

The word column.

TYPE: TEXT

<br />

<br />

Constant Value: "word"  

### _ID

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

```
public static final String _ID
```

<br />

<br />

Constant Value: "_id"

## Fields

### CONTENT_URI

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

```
public static final Uri CONTENT_URI
```

The content:// style URL for this table

<br />

## Public constructors

### Words

```
public Words ()
```

<br />

<br />

## Public methods

### addWord

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

```
public static void addWord (Context context, 
                String word, 
                int frequency, 
                int localeType)
```

<br />

**This method was deprecated in API level 16.**   
Please use[addWord(android.content.Context, java.lang.String, int, java.lang.String, java.util.Locale)](https://developer.android.com/reference/android/provider/UserDictionary.Words#addWord(android.content.Context,%20java.lang.String,%20int,%20java.lang.String,%20java.util.Locale))instead.

Adds a word to the dictionary, with the given frequency and the specified specified locale type.

<br />

|                                                                                                                                                        Parameters                                                                                                                                                         ||
|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `context`    | `Context`: the current application context <br />                                                                                                                                                                                                                                                           |
| `word`       | `String`: the word to add to the dictionary. This should not be null or empty. <br />                                                                                                                                                                                                                       |
| `frequency`  | `int` <br />                                                                                                                                                                                                                                                                                                |
| `localeType` | `int`: the locale type for this word. It should be one of[LOCALE_TYPE_ALL](https://developer.android.com/reference/android/provider/UserDictionary.Words#LOCALE_TYPE_ALL)or[LOCALE_TYPE_CURRENT](https://developer.android.com/reference/android/provider/UserDictionary.Words#LOCALE_TYPE_CURRENT). <br /> |

### addWord

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

```
public static void addWord (Context context, 
                String word, 
                int frequency, 
                String shortcut, 
                Locale locale)
```

Adds a word to the dictionary, with the given frequency and the specified locale type.

<br />

|                                                                                 Parameters                                                                                  ||
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `context`   | `Context`: the current application context <br />                                                                                                              |
| `word`      | `String`: the word to add to the dictionary. This should not be null or empty. <br />                                                                          |
| `frequency` | `int` <br />                                                                                                                                                   |
| `shortcut`  | `String`: optional shortcut spelling for this word. When the shortcut is typed, the word may be suggested by applications that support it. May be null. <br /> |
| `locale`    | `Locale`: the locale to insert the word for, or null to insert the word for all locales. <br />                                                                |