How to insert unicode symbol in EditText from Custom Keyboard - android

I've a custom keyboard from where I want to insert the symbol ⏺ in the currently active EditText. I use this:
getCurrentInputConnection().commitText("\u23FA", "\u23FA".length());
But this inserts just a space (no visible character). I think Android doesn't support all unicode characters but is there any way to insert this symbol??

why dont you try the following 2 options in your java code:
editText.setText("\u23FA");
or
editText.getText().append("\u23FA");
let me know how you got on ok?

Related

How to autocomplete words with spaces in between in an edittext

I am trying to make a code editor for various programming languages but I am unable to add autocomplete feature to it.
I tried to use MultiAutoCompleteTextView but it takes , as the default separator between words.
For reference I want to make an app like ACODE
Use this line in your code:
yourmultiAutoCompletetextViewname.setTokenizer(new SpaceTokenizer());
This will make space as a seperator between two words.

Show numeric keyboard with alphanumeric switching option

Hello can anyone tell me how to show the following keyboard layout pragmatically in android.
Rather than choosing the type of keyboard consider setting the input type in the editText via:
android:inputType="XXXXXXX"
(Doing this can change the type of keyboard that appears when you want to provide input to the editText)
Replace the XXXXX text with any of these values according to your use case.
You can also add the android:imeOptions="XXXXXX" attribute to your editText.
Replace XXXXXX with any of these values.
You can learn more here

display multiline/multiple characters as key label on soft keyboard keys

Hi i am working on android soft keyboard. Normally labels displayed on
keys are single character as shown below
the above one is done by just using keylabel attribute of Key tag in Keyboard
to display whatever text we want on the key. But now my requirement is to display multiple characters on single key as shown below
I got one solution to this by using android:keyIcon but limitation is I need the color of characters to be configurable so that a user can change color of any character. Like 1 with red, | with blue, q with green. So it must be configurable to any color.That's why I skipped keyIcon property for displaying text on character.
So is there any way to set multiple characters on key.
The standard KeyboardView provided by android framework doesn't support displaying secondary text (or multiple characters). To achieve your desired functionality you need to subclass the KeyboardView(or simply View) and implement its onDraw method and draw directly to the Canvas.
You can check the source code of latinIME KeyboardView where its been implemented using hint label.
Also you need to write your own parser for parsing the Keyboard xml. you can check here how its done in LatinIME.
Understanding the complete package Keyboard in LatinIME will be very helpful for your requirement.
Hi I have done it with by taking reference of Customize the appearance of a <Key>
By playing with given code after three days i have got my solution.

Android Keyboard font change

I am creating a custom keyboard using KeyboardView class provided in API. I want to change the typeface of the label of keys. (i.e. using kiran.ttf file, 'K' will then Displayed as 'क')
I have searched a lot, but couldn't succeeded yet.
Thanks in advance.
The only real way to do this (and have it output the correct symbol to an EditText when using the keyboard) is to use UTF-8 unicodes. I'm currently developing an engineering keyboard, and I simply found all the symbols I needed, then I output the unicode using getCurrentInputConnection().commitText("\u2220", 1);
In your case, if you were looking for that character you've got in the question, it's unicode is \u0915
Adding that to my keyboard (for demonstration purposes) gives me this:
with the output in the editText near the top of the screen. The key itself is in the top left corner of the keyboard. The specific set of unicode that comes from is called "Devanagari", and the characters can be found here: http://unicode.org/charts/PDF/U0900.pdf.
Hope that helps!

HTML/ASCII Symbols in TextView?

Is there a way to represent special HTML characters in a EditText in Android? I want to display symbols like section signs (§), bullet points (•), degrees (°), etc.
Is there a way to do this?
Thanks!
EDIT: The original post had asked about a TextView, but my intended question is about EditTexts. I want the user to be able to press the button corresponding to the symbol they want, and the symbol will be added to the EditText, and they then resume typing.
Have you tried \u00A7 \u2022 and \u00B0 in setText?
That are unicode numbers of those characters.
For EditText, you just have to create buttons with mEditText.getText().append(character) and probably mEditText.focus().
Have you looked at the Html.fromHtml(...) methods?
Alternatively you could just use a WebView instead of a TextView and use loadData(...) to load an HTML string.

Categories

Resources