Is there any way to input special characters (which are not present in the default soft keyboard ,eg. theta) in an Android EditText?
Thanks..
Well as per your need, I would like to suggest to create a custom keyboard because the stock keyboard which comes with the device may not have the special characters you need.
You can refer the following tutorial to create a custom keyboard
http://www.fampennings.nl/maarten/android/09keyboard/index.htm
or you can see this search result which may serve your purpose,
https://github.com/search?q=android+custom+keyboard&ref=cmdform
And from below site you can get the list of Unicode characters which Android supports,
http://en.wikipedia.org/wiki/List_of_Unicode_characters
http://unicode-table.com/en/#0026
Note: Writing the whole code to create a custom keyboard is beyond the scope of this answer, so I mentioned the reference link.
What you are going to do is to create a custom keyboard. First thing you want is to hide the default keyboard when an EditText is focused:
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
Now, you must create a custom layout (RelativeLayout or Multiple LinearLayouts this is your desire), create and set text to the buttons that you want to show. Make this keyboard view setVisibility(View.INVISIBLE) or setVisibility(View.GONE), and whenever your EditText is focused, make it setVisibility(View.VISIBLE).
After keyboard is visible, programming the rest is up to you it is practically easy.
If you also need a guide, here is an example.
Related
I managed to create a simple qwerty android keyboard with a tutorial
I just edited the layout to be a qwerty keyboard. now I want to add a second keyboard "view" with around 50 Unicode characters and have an option in the keyboard to switch between the "views" using a button. This is similar to the qwerty and symbols view of the default softkeyboards.
I found this online but I am not sure how to use that (how to get the imeToken, should I somehow initialize both layouts first, I basically don't have any idea how to start)
I know that you can specify a short message input type in order to turn the enter key of the keyboard into an emoji button and pressing it will show up the emoji list but what i want to do is open up the emoji list programatically from a button. Is this possible?
There is no functionality to add tabs to any generic keyboard. Certain keyboards may support it, but it isn't a common feature. You could write your own fully custom keyboard, but that's a lot of work and will piss off many users.
Also, I'm not sure what you mean about by like in hangouts. I use hangouts- it doesn't do anything odd with my keyboard. It stays as Swype, there's no special emoji tab. It may be a feature of your favorite keyboard based on the input type (I assume both use input type textShortMessage). But it isn't a generic feature.
See Link Android Keyboard with Emoji
Thanks and enjoy...
The input type for my EditText control is set to "number." When the numeric keypad is displayed, besides showing the numbers, it also shows calculator keys (+/-/etc.). I am wondering if there is any setting to remove the calculator keys.
Thank you in advance for your help.
If all you need are actual numbers 0-9 you could set your keyboard type to "phone" instead of "number" which should give you a more 9-pad style keyboard that probably won't contain the extra keys like +, - etc...
However in the end it is up the currently running keyboard application (which is chosen by the user) If whatever keyboard they happen to be using shows keys that you would rather it not, there is generally no way for you to instruct it not to show those keys.
If you want to have complete control over the input then you'll have to create your own View that mimics the functionality of the keyboard and "manually" insert the typed characters into your EditText.
Add this line of code
input.setInputType(InputType.TYPE_CLASS_NUMBER);
Hope it helps.
Is there a way to programmatically remove certain keys from the standard software keyboard. By setting some of the input type flags I am so close to having the keyboard I need. From the calling application is there a way to modify the keyboard directly. I know how to make my own custom keyboard but it seems such a waste to remove one button from the standard one.
////// edit///////
I think I found a way around this if any one has tried this method please let me know if it worked for you.
I have going to grab the softKeyboard service and using the start hook the keyboard uses to grab its view object inflate my own and swap them.
From my research there is no way to implement your own custom keyboard from within a single application. If you want to have a custom keyboard you need to create one from scratch and can not use the IME
soft keyboard comes for edit text. you can modify the softkeyboard for that edit text.
For that you need to set inputType and imeOption property of that edit text.
Is there a way to create an app specific soft keyboard on Android? After reading about InputMethodService docs and checking out alternative keyboard apps out there, I figure the alternate keyboard can only be configured for system wide usage (through Settings -> Locale and Text).
If the answer to above question is no, then is there at least a way to load a custom dictionary and override the default dictionary of the system keyboard (only when my app is in use)? That will help in giving very relevant suggestions to the user when he has only tapped couple of keys.
If you just want a View that looks and acts like a soft keyboard, I did that in my SmallKeyboard class. You just need to extend android.inputmethodservice.KeyboardView and decide on layout. See the onKey and onText methods at the end of that file for the action taken when keys are pressed.
Instead of my keyboard model inner class, you could load it from XML if your key set is fairly constant.
The Android Nethack application has a complete and clear source code example of how to create a custom keyboard for an application, how to display it on screen and how to define multiple keyboard layouts. It contains pretty much everything you need to know.
It is by far the best example I have seen.
http://code.google.com/p/nethack-android/