kcode
kcode

Reputation: 1280

How to prevent input to be stored in android user dictionary

From a developer perspective: Is there a way to prevent user input to be added to the user's dictionary in my android app?

If I set the text field to android:password it doesn't, but I don't want to use a password field for that.

Thanks!

Upvotes: 1

Views: 4286

Answers (2)

Jacob Ras
Jacob Ras

Reputation: 5969

Using textNoSuggestions will disable word suggestions, and should also disable the auto-saving of words as suggestions (HTC phones usually save every unique word as a suggestion):

android:inputType="textNoSuggestions"

For more information, read the developer docs:

textNoSuggestions
Can be combined with text and its variations to indicate that the IME should not show any dictionary-based word suggestions.

If that's not working you could also try to set it as a password field with visible characters:

android:inputType="textVisiblePassword"

Upvotes: 1

Gapton
Gapton

Reputation: 2134

On Nexus phones, to add a word to user's dictionary, you have to use the android keyboard, type the word, and select it, and tap it again to save to dictionary.

Alternatively, you can add words in Settings, where you can type whatever words you wanna put into the dictionary.

Some phones don't come with a default Android Keyboard, so how their user's dictionary functions is beyond me. (HTC seems to save every single unique word you have ever typed)

Since you have no control of the keyboards installed on your users' devices, I don't think there is a way to control this.

Even if you somehow prevent Android Keyboard or any other third-party keyboards from saving words to the dictionary, I don't think you will be able to stop the user from pressing Menu > Settings > Language and Keyboards > User dictionary , and edit their words there.

Finally, I am really curious why would you want to limit this feature for your App.

Upvotes: 1

Related Questions