Flash APIs for Android Platform - android

My usage is very limited. All i need to do is to invoke the soft keyboard from within my flash application. Is there anything I can do, without using a textfield or any such editable controls, which will pop up the keyboard.
Thanks

So basically you need to have some sort of object that is interactive (that is, a textfield or something similar) to call up the on screen keyboard. This is probably because flash needs to set the focus for typing to that object. The object needs to be of type or of base type (somewhere in inheritance) InteractiveObject. You used the requestSoftKeyboard() method. Check it out:
http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/display/InteractiveObject.html#requestSoftKeyboard()
http://blogs.adobe.com/cantrell/archives/2011/03/everything-new-in-adobe-air-2-6.html

Related

Custom Keys to Android default keyboard

I am trying to add some custom keys to the soft keyboard (like a new row of specialized keys on top of the existing keyboard)
I assume the only way would be to get a reference to that keyboard. I know it's possible to get the size of the keyboard (using ViewTreeObserver), but I can't find a way to get the actual keyboard object.
Also, I can add a custom keyboard, but there are a few things that makes everything a bit more complicated, like switching from alphanumeric to special characters and also Shift behaviour. So that's why I'd prefer adding the keys to the existing keyboard, if possible.
Can anyone confirm that's possible? Or that it's not possible?
Thanks a lot!

Custom keyboard for Android app

I'd like to create custom keyboard in my app. I've found that I should create new Input Method. But I don't know how to set this Method to my EditText and disable standard keyboard. I do not want user to have a possibility to change this keyboard. May I solve this with custom Input Method or should I create keyboard as custom view instead?
But I don't know how to set this Method to my EditText and disable standard keyboard
You can't. The user chooses the input method, because the input method is system-wide.
May I solve this with custom Input Method or should I create keyboard as custom view instead?
Unless you are going to take the time to support all users — the visually impaired, those using a physical keyboard, etc. — you should not do this at all.
Assuming that you are going to handle all users, it would need to be a custom view if you are going to force the user to use it.

How to use OnKeyboardActionListener?

Simply say, is there any example about 'OnKeyboardActionListener'?
I want to call my method, whenever user type any character on keyboard.
OnKeyListener or OnKeyDown is not called when the word is composing. <- it's a problem.
So, I'm trying to use 'OnKeyboardActionListener' to solve the problem above.
Simply say, is there any example about
'OnKeyboardActionListener'?
This interface is used in the creation of input method editors ("soft keyboards"). The SoftKeyboard sample that shipped with your SDK uses this interface.
I want to call my method, whenever
user type any character on keyboard.
If this is your own keyboard, follow the SoftKeyboard example.
OnKeyboardActionListener is for implementing software keyboards.
OnKeyListener and OnKeyDown do not get called, as you have discovered, when using a software keyboard. They only get called when using a hardware keyboard, which many Android devices don't even have.
I assume what you are trying to do is capture key events as they are occurring in an EditText area. Your best bet in this case, in order to handle both software keyboard input and hardware keyboard input, is to register a TextWatcher via the addTextChangedListener() method.
Note that on phones with Android 2.1 and later, such as the Nexus One, people have the option of using speech recognition to input text into your EditText instead of typing the text. When they do that you may get full words, or even full sentences, entered all at once. So you need to check the entire contents of the EditText field when there is a change to the contents.

How do i add words to the suggestions on top of the soft keyboard

Is there any way to add words to the suggestions in the soft keyboard?
For a specific Edittext field i would like to add a list of names to the suggestions that pops up on top of the soft keyboard in android 2.0.
Does anyone know if this is possible?
Here is the source code of the soft keyboard.
If you go through the code, you will see that it uses a Suggest class which inside has different dictionaries.
If you want to add words for a specific EditText you would need to add and remove or change freq of a certain word from those dictionaries.
Some issues:
I couldn't find a way to get the InputMethodService's instance. (If you can, please answer my question here)
Android allows developers to program their own InputMethodService. I am working on one myself and my implementation doesn't use that dictionaries. So your feature will not work with my IME.
I would suggest using Auto Complete.
You can't add additional words to the ones the IME finds internally, however you can whole-sale supply your own completions via InputMethodManager.displayCompletions():
http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html#displayCompletions(android.view.View, android.view.inputmethod.CompletionInfo[])
This is what the auto complete text view uses to show its completions in the IME, when the IME is full screen so it can't be seen. Note that your app is still responsible for showing the completions itself, so they will be available to the user if the IME is not full screen.
(And sorry about the lack of documentation on that method.)

android app specific soft keyboard

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/

Categories

Resources