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.
Related
I created a keyboard app that will use unicode for keys characters and input. The language is not available on the current android system fonts available. So I loaded it in my app and assigned it on a TextView in the MainActivity.
I can see the characters in the app's TextView when I type using the keyboard. But when I change to some other application like a Message App, it doesn't show. (I am currently not loading the characters on the keyboard keys because that is a separate thing)
So I googled and find nothing to fix this problem. (I don't want rooting). I was thinking of this,
Can I load the font to some kind of a service so that all apps can use the font? OR is there any way to work around on this? I am open to any suggestion. Thank you in advance.
If the device does not support UTF-8 fonts/characters, There is no workaround to achieve such functionality. However, you can create a custom keyboard for it but it will be limited to your application only. finally the answer is there is no way to achieve it if the device does not support utf-8 encoding.
I am a linguist, not a programmer, sorry. I was asked and am adapting a keyboard for a minority language in Africa. I have spent a lot of time on this and am willing to learn more and to dig deeper.
I am using the latest Android Studio in Windows 10 and am working from a code sample from Google here:
https://android.googlesource.com/platform/development/+/master/samples/SoftKeyboard?autodive=0%2F
I managed to adapt this sample to our local language and compile and install in a several different phones from our team and all the new characters in the alphabet are working fine (ǝƎ ŋŊ ɖƉ ɔƆ ɛƐ ɩƖ ʊƱ). No problems here, this is just background for those who like that.
The unexpected behaviour is sadly with several existing keys, which I have not altered: apostrophe, quotation marks, hyphen, etc. Those are characters which to me "are too active"; possibly an escaping-problem or something the like.
When using my new keyboard in WhatsApp I can type any text just fine, until I need (for example) an apostrophe. Then the apostrophe will delete any alphabet-letter backwards until it hits a "resisting character" (those are space, full stop, comma and some others) and then it will show itself. Example sentence: "Three pigs' house."
I am typing this:
Three pigs
then I hit apostrophe and am expecting this:
Three pigs'
but instead I get this:
Three '
You can see how the apostrophe has deleted "pigs" and has been stopped by the space behind "Three". The same happens for - and for " and for a few other "bad keys".
I have this unwanted behaviour in several "powerful apps" like WhatsApp and Telegram but NOT in a simple text editor like this one:
https://play.google.com/store/apps/details?id=com.maxistar.textpad
I double-checked and compiled the original sample keyboard: It shows the same bad behaviour in WhatsApp, Telegram etc. but not in Simple Text Editor.
So the Google sample SoftKeyboard is having issues. I quote their doc:
Example of writing an input method for a soft keyboard. This code is
focused on simplicity over completeness, so it should in no way be considered
to be a complete soft keyboard implementation. Its purpose is to provide
a basic example for how you would get started writing an input method, to
be fleshed out as appropriate.
I would like help please:
Is this really a problem with the keyboard, or is the fault with WhatsApp etc. for "doing too much" with the characters being sent by the keyboard?
Or how can I find out where the deleting is happening? (Since this is only an input method, the Android Studio's debugging tools do not yet work for me.)
Is there a forum, where I can get help for that specific SoftKeyboard?
Any input to help me to change my self-made keyboard so that it behaves normally in any App which needs text-input, even WhatsApp, Telegram and the like.
Or is there another working template out there, which I could use to make a working soft keyboard for our language. Since I am not a pro, I am hoping for something that I can import into Android Studio for adapting.
Please do not yell at me. Any input and any help is welcome. I can upload my files, but the behaviour can be observed from the original SoftKeyboard files (see my first link at top). If you can type your own language, please be grateful. My people would also love to write their language in WhatsApp. Thank you.
First update:
I have looked over the main Keybaord.java file and have changed
mPredictionOn = true;
to
mPredictionOn = false;
for
case InputType.TYPE_CLASS_TEXT:
This has helped to calm the unexpected behaviour but has also lost some of the functionality. And the caps state is no longer auto-undoing like it is meant to be after user hits one capital letter.
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
I do understand that Android device still doesn't support complex hindi conjuncts drawing, though we set the textView typeface to a commonly used hindi font (mangal.ttf or DroidHindi.ttf).
One of the Ex:
1st 2nd Conjunct
प् र = प्र
"प्र" is been shown as...प् र { list of frequently used conjuncts - link)
What I would be interested to know is - Though android devices(I am using Galaxy-SII, os2.3) doesn't support it yet, is there a workaround for this?
Similar questions (but no workaround yet):
Android: unable to show correct hindi words
How can i show HIndi text in Android Tablet
For the question-2: #Sahaja does mention that android device doesn't support hindi complex conjuncts drawing. So does it mean that we won't be able to do anything in this regard until android adds the support for it or can we have a feasible workaround?
One workaround, which I can think of:
Convert the whole hindi database into a custom non-unicode format & use a non-unicode font (like kiran.ttf - link) to display it. This sounds like too much of effort, not sure if this is a feasible solution (not tried it yet - kept as last option) or something else would also work?
Please let me know, your thoughts on the same.
(Note: This problem has nothing to do with what custom hindi font I use or is it ttf or otf.)
Thanks,
Shibbs
I have recently been through the same problem but unfortunately didn't find any solution. I agree that some of the text won't appear properly i.e. some of it may appear misplaced characters. If you try running it on device that is 3.0 or above (I am unsure of below 3.0), then you should be able to see it properly. Or try choosing en emulator with higher which has more than 4.0.
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.