Include Word Suggestions in Android Keyboard - android

Hi I want to include word suggestions in my custom keyboard.
e.g if I write wi it should suggest me whether you want to write "winner" "winks" "wilson" etc
Please guide me.
Thanks

Here is the real answer to this question.
It was hard for me to find:
First you need to:
Add Words to Android's UserDictionary
By having the words in the dictionary, they will show up in suggestions.
If you want to exclusively show your words however, then something like the auto-complete dropdown idea is a better fit (that the other answers linked)

You can search for source code for android keyboard that are having this suggestion bars, i.e. download source for android gingerbread 2.3 keyboard source code, as android is opensource you can get the code easily.

Related

Android EditText - changing new input style

I'm trying to write a simple rich text editor application. I would like to be able to press different "style" buttons (e.g. bold, italic) to make all further inputs have that style, just like I could in an office application.
I was thinking I could have every new character be selected in a SpannableString and then change its style, but I don't know how I could do that. I tried setting an OnTextChangedListener but I later found out it's probably not suitable for what I want to do. If I knew how to listen for all new inputs I could probably figure something out, but I can't find anything that does that.
Any help is appreciated.
Please have a look at this eBay Open Source Android project called the Mildly Rich Text Editor that I am currently working on. It is a rich text editing library adapted from Droid Writer that makes use of spans. It can also be imported as a library in your application.
There is a demo app included in the repository that you can build and try out.
Note that there are some limitations noted in the "issues" section of the GitHub repository (e.g. it does not currently work with custom keyboards). Please also feel free to contribute.
you can get help with https://developer.android.com/training/keyboard-input/commands.html
you can use onkeypress or onclick event and check for that key with ASCII values of keys

Custom android keyboard

I am creating a custom android keyboard. For word spelling correction and suggestion I am using the android spellCorrection framework, but in some Samsung devices new SpellCheckerSession method returns null. Can someone help me to solve this issue.
Is there any third party library for auto spelling correction or word suggestion like google keyboard.
You should check out Jazzy. and yes its been last updated 2005 but its not a
big issue because many of use this one and its for English language only when i used now dont know status.
helping link
http://moderntone.blogspot.in/2013/02/tutorial-on-jazzy-spell-checker.html
hope this helps...

Shown emojis are different to them chosen, why?

I just implemented this library in my android app (with your help):
https://github.com/ankushsachdeva/emojicon
It looks like this now:
As you can see, the smiley I picked from the menu looks different to the one send. Its another theme or someting like that.
Is this controlled by each smartphone itself? How does this work? Does anyone know? How can I fix that?
Thanks!
I think it depends on the OS, (smartphones, computers or any devices). Emojis are just unicode characters which have to be interpreted. And i was was surprised when i managed to compile a c/c++ program with emojis as std output on my Mac (and had a custom terminal prompt with lot of emojis). But obviously i don't think I could compile that on a Linux machine.
You should do something on your TextField so that it will correctly read the emojis, and not with the default behaviour/encoding.
Hope this will help you :
http://www.unicode.org/reports/tr51/index.html
The TextView you must be creating in the xml should be EmojiconTextView instead of normal TextView. Same way make your EditText as EmojiconEditText so that it can read the emoji as well.
If you want to understand why this is happening, then the answer is, Emojis are nothing but unicodes. Your TextViews and EditTexts needs to be taught how to read them. If you use normal EditText, it will read it the Android way, if you use EmojiconEditText, it will read it the library way.

Show suggestions of AutoCompleteTextView

Is it possible to have the AutoCompleteTextView show the suggestions above the keyboard just like when using the default dictionary? (If yes, how:))
Or can I use my own database to show suggestion when using EditText?
Hope you understand what I mean:)
Thank you
Bastaixen
I don't think this is possible. The suggestions shown above the keyboard are actually part of the IME, so completely unrelated to your application / activity.
The only way to do this would be for you to build-in your own IME and then you can customize what suggestions would be there. You can base it on latinIME, but there are still a couple of things you would need to figure out:
You would need to figure out how to tell Android to use your custom IME in your app. Or, like this answer say, just build in the keyboard in your app.
if your user is using a different keyboard (for different language, or swype or something like that), they would probably not like it much...

Create an Android Keyboard Dictionary

So I would like to know how to create a dictionary, like the english/spanish ones that are included already on the phone. What I want to do is put the english and spanish one together so that users do not have to switch between them, and also add words that are products of combining english and spanish together to make a word. How could I do this? What do I need? And I want to create the dictionary used by the keyboard, not a keyboard.
Thanks in advance!
Take a look at this: http://developer.android.com/resources/articles/creating-input-method.html
For an example with support for multiple input types and text prediction you can also have a look at the LatinIME source code. The Android SDK also includes a SoftKeyboard sample too.

Categories

Resources