How to programatically change keyboard language to Arabic? - android

I'm working on an Android app that needs to take input in Arabic whenever the User taps on an EditText view. So how do I change the keyboard language programatically or ask the User to do so?
I conducted extensive research and found out that it can be done via:
a) creating a custom Arabic keyboard,
b) using the IME manager to prompt the user to change input method by calling showInputMethodPicker(),
c) using the IME manager to change input method by calling setInputMethod.
of these, (c) is only workable for System apps, and (a) requires a lot of time (which I currently don't have), and (b) requires the user to manually enable it.
Is there absolutely ANY simple and workable way to accomplish this? Any external API that I could use or anything at all?

https://www.codeproject.com/Questions/996415/ceate-custom-arabic-keyboard-for-android
Above link can help you.For getting above required feature you need to make custom keyboard Arabic then open that keyboard when you type in edit text.

Related

how can I record Gboard typing in other apps from a service

What I want to do is to make an Android app with the same functionality callable by typing special words into the Google keyboard at any moment in which it is open (even if it is used into another app).
The easiest solution to achieve this is by making my own keyboard and let the user set it as default but I would prefer to insert this functionality to the Gboard so the user does not have to change his keyboard application
So the question is:
How can I know from a service what's typed into the Gboard even when the keyboard is used by other applications?
is it possible?

Creating an IME in Android, how can I only cover one input type and let another keyboard handle all others?

I'm following posts like:
How to develop a soft keyboard for Android?
Create Custom Keyboard in Android
I was wondering though, is their a way to default to using another keyboard?
IE: I want to only cover the email input, nothing else. What can I do to make it use the system keyboard, or Swift or another keyboard for all other inputs (Numbers, general text etc.).
http://developer.android.com/reference/android/text/InputType.html
Any help is appreciated, I've not gotten to play too much with this, just want to see feasibility before I start a project.
Cheers,
Justin W.
Using InputMethodService, you can definitely switch to another IME if you want to.
But, once another IME is activated, you cant switch from another IME to your IME. This is for security reasons.
It's clearly mentioned in the Docs.
A client application can ask that the system let the user pick a new
IME, but can not programmatically switch to one itself. This avoids
malicious applications from switching the user to their own IME, which
remains running when the user navigates away to another application.
An IME, on the other hand, is allowed to programmatically switch the
system to another IME, since it already has full control of user
input.

Numeric keyboard as default, but allow text

I'm currently developing an application targeted at android and desktop devices using apache cordova and HTML5.
In order to get the numeric keyboard to pop up I've used input type="number", which works fine.
However, the input field should also accept strings. The current functionality of type=number is that the ui seems to allow for strings to be entered, but the value property of the element is not changed if the input is invalid (e.g not numberic).
Is there a way of getting the numberic keyboard on mobile devices, while still being able to enter text?
My inital tries consisted of capturing the keydown event and manually setting the this.value property. I've tried this using jQuerys .val() and of course the more 'native' approach element.val += char. None of which work. UI is updated, but the change is not reflected in the model.
EDIT
For the next guy trying to achieve this.
1) The HTML solution.
As #LuudJacobs mentions in the comments below; There's currently no way to decide which keyboard is shown except for defining the type-attribute. Though some devices have a button to go back to alphabet keyboard, its not the case for every device. And can not be used reliably.
2) Writing a phonegap/cordova plugin.
It is possible to write a plugin to show and hide the keyboard at will. But, as far as I could find, there is currently no way of programmatically telling it to default to the symbols keyboard. Thus the functionality achieved is similar to using type=number and type=text in the HTML. Another problem with this approach is the diversity of keyboard for android devices, where even users themselves can install their custom keyboard. The functionality of the keyboard can are therefore unknown. What works on one device, may not work on the next.
3) JS/HTML/Canvas solution
Finally... A feasible solution. I suggest taking a look at this walkthrough as it shows an easy way to creating the keyboard using just html and js. Another option would be to use a canvas, and draw the keyboard yourself, but I would imagine that this is more error prone and harder to do.
As explained in the HTML5 spec you can not have anything but valid floats in a input type="number". So You can not. On a sidenote: how would users enter text when they'd only have a numeric keyboard?

Can i add custom keyboard to the core keyboard?

Hey this is a simple question but i can't seem to find an answer for it.
I'm intrested in creating something like a smilies keyboard to be added to the native keyboard so a person can add them in emails/SMS etc.
Now i guess i can edit the OS itself and add it to keyboard, but i was wondering if i can attach to the event that opens the keyboard and edit it?
Again, i'm NOT intrested in a custom keyboard inside my app, i want while my app is open (if possible without, better) to change the regular keyboard.
Is this possible?
i was wondering if i can attach to the event that opens the keyboard and edit it?
No, sorry. That is a different application than yours; you cannot change it at runtime.
You are welcome to build your own input method editor and use that, though. Or, perhaps you could make a contribution to some existing open source input method editor project.

How to add own custom IME at Select Input method dialog

I'd like to show my own IME in the Select input method chooser dialog like the Japanese IME and the Chinese IME. How can I do that?
I am new to Android. I have tested Greek IME and other IME. Although .apk is successfully uploaded. But can't show in it and how to choose own IME from this place.
What do I need to do in my code?
You probably need to activate the installed keyboards before you can select them in the Input Method menu. For this you need to open Settings -> Language & Keyboard and in this menu check the keyboards you would like to use. This probably should get your GreekIME running.
Now for coding your own soft keyboard, there is an example which is delivered with the Android SDK. You can find it in <Andoid SDK Base>/samples/SoftKeyboard. The process is a bit poorly documented, but when you get the example up and running you can start to tweak the example a bit and you should get the hang of it.
Nice writeup about
Onscreen Input Methods from developer.android.com
In part ...
What is an input method?
The Android IMF is designed to support a variety of IMEs, including soft keyboard, hand-writing recognizers, and hard keyboard translators. Our focus, however, will be on soft keyboards, since this is the kind of input method that is currently part of the platform.

Categories

Resources