Custom Dictionary (not keyboard) for Android apps - android

Is there a way to load an app specific custom dictionary for android keyboard auto-complete to show to the users? My app uses a few hundred words only and any input other than these words is going to be useless.
I want to just load the word list used in my app and override the default android (or swype/swiftkey dictionaries if they are installed), without the hassle of implementing a full blown keyboard.
I have seen a couple of similar questions like here, but nothing that answers my question. Android IME again requires you to write a keyboard.

I think that make SQLite database in your application in your android application and load this data in the autocomplete and when the user entered the text then check that whether the word he entered lies in that database or not. If yes, then keep this in that textbox otherwise make text of that textbox empty i.e "". Hope that this will work for you....

Related

Is it possible for an app to prevent the keyboard from learning words on Android?

I am developing an Android application (Xamarin Forms) where the user will be entering personal and potentially sensitive information. I would like to prevent the keyboard from "learning" words that the user enters into the application.
I know it is possible for the user to manually delete learned words from their phone (as explained here: https://trendblog.net/delete-learned-words-android-keyboard/ ) but is it possible for an application, or specifically text entries, to tell Android to not learn from entered text?
In Xamarin Forms Entry, try turning off text prediction:
<Entry ... IsTextPredictionEnabled="false" />
I don't know whether that also disables "remembering" what you type. Try it, and leave a comment whether that worked.
If no cross-platform solution is suggested, then you'll need to make a "custom renderer" for Entry, in your .Android project.
There, behavior is controlled by the input type.
Try visible password or maybe no suggestions. (not sure exactly what those are in xamarin, but intellisense will show you the options, at the right place in the custom renderer's code.)

Custom Keyboard like Gboard for Android

I'm looking for references to do a keyboard app like Gboard.
I checked GitHub and googled for custom keyboard for android code and I still don't know what to do.
I came across AnySoftKeyboard but it seems complicated and I think it's not what I'm looking for.
I don't need the keyboard to be that customised, I want to have a search functionality when a user clicked on a key from the keyboard, it will show an input field where the user can type any text and automatically search on the internet about the typedText and display the searches then user can share it as part of the text he/she will send to the recipient.
Creating an Input Method Editor from the Android Docs

How to get access to the edittext box in the android messenger app

I am trying to make an app to where I can get custom emojis to be added to the edittext field in the android messenger app and I am having a hard time getting access to that edit text field. Can anybody provide any help with this. I am attaching an image.
Androids security model prevents all apps but the currently active keyboard from modifying the text input.
You have several options:
Register your app as keyboard. Users can switch to and from your keyboard, so it can just include the additional symbols you want to add (and doesn't have to be a full-bleed keyboard).
Copy the symbols to the clipboard. Users have to manually paste them.
Use Xposed to inject your code (requires root). This works around the Android security model.

Numeric keyboard as default, but allow text

I'm currently developing an application targeted at android and desktop devices using apache cordova and HTML5.
In order to get the numeric keyboard to pop up I've used input type="number", which works fine.
However, the input field should also accept strings. The current functionality of type=number is that the ui seems to allow for strings to be entered, but the value property of the element is not changed if the input is invalid (e.g not numberic).
Is there a way of getting the numberic keyboard on mobile devices, while still being able to enter text?
My inital tries consisted of capturing the keydown event and manually setting the this.value property. I've tried this using jQuerys .val() and of course the more 'native' approach element.val += char. None of which work. UI is updated, but the change is not reflected in the model.
EDIT
For the next guy trying to achieve this.
1) The HTML solution.
As #LuudJacobs mentions in the comments below; There's currently no way to decide which keyboard is shown except for defining the type-attribute. Though some devices have a button to go back to alphabet keyboard, its not the case for every device. And can not be used reliably.
2) Writing a phonegap/cordova plugin.
It is possible to write a plugin to show and hide the keyboard at will. But, as far as I could find, there is currently no way of programmatically telling it to default to the symbols keyboard. Thus the functionality achieved is similar to using type=number and type=text in the HTML. Another problem with this approach is the diversity of keyboard for android devices, where even users themselves can install their custom keyboard. The functionality of the keyboard can are therefore unknown. What works on one device, may not work on the next.
3) JS/HTML/Canvas solution
Finally... A feasible solution. I suggest taking a look at this walkthrough as it shows an easy way to creating the keyboard using just html and js. Another option would be to use a canvas, and draw the keyboard yourself, but I would imagine that this is more error prone and harder to do.
As explained in the HTML5 spec you can not have anything but valid floats in a input type="number". So You can not. On a sidenote: how would users enter text when they'd only have a numeric keyboard?

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!
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.
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"

Categories

Resources