Android external keyboard custom layout, extra keys - android

I've been working on a .kcm file to give me my layout of choice on android. It's a rather obscure swedish dvorak version called se_sv_dvorak, http://tlundqvist.org/sv_dvorak/ .
I'm using a mac bluetooth keyboard like this: http://www.netonnet.se/ItemImages/dator/laptop/till-din-mac/mss-och-tangentbord/apple-wirelesskeyboard(160756)-Large.jpg
As you can see, this keyboard has more keys than an american keyboard, specifically the right of the ä-key, where US keyboards have apostrophe.
How can I implement this extra key?
Sincerely,
Love

I realised that when I hit the key in question it gave me the same character as the key to the left of Z (see picture). At first I thought this was a buggy reaction to being unbound but I soon figured out that they both were bound in the .kl file to the same keycode (D'uh)!
They were both bound to BACKSLASH for some reason. I bound one of them to HENKAN (something japanese maybe?) in the .kl file and bound HENKAN to ; and : in the .kcm file.
Everything seems to be working perfectly and I can finally start developing on my huge Xperia Z Ultra! :)
I'm sending my work to the original developer and maintainer of the layout. Maybe he will upload it to his drivers page. If someone comes here looking for this layout on android, head over to his site or send me a message!
Love and light

Related

New Android keyboard behaving unexpectedly in certain apps

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.

Android app (Kakuro helper) destined for Google Play Store advice needed

I have an app that I would like to submit to Google Play Store, just to be able to say I have an app that others would find useful. I thought it would be a freebie until I found a similar app-for-pay that mine has more features than. Mine also looks better. Whatever, my questions are about the keypad.
Here are screen shots of input screens, one with output filtering. Output pops up after the Show button is pressed. (The Help button clarifies the overly-terse "output filtering" portion.)
The only keys I need are the ten digits 0-9 and the backspace and Next keys.
Is there an input type that I haven't stumbled onto yet that would have just those 12 keys?
Or is there a way to hide the math symbol, ABC, and "Swype" keys? (Their presence isn't overly distracting, but it would be better without them.)
(I know I could try to design my own custom keypad, but it would be really hard to set up a dozen listeners for a dozen new buttons and have to handle my own text field editing. Meanwhile, the existing look and feel is standard and the app is FINISHED if I don't go this route! It wouldn't be wise to go this route would it? A lot more work not worth the effort?)
there is an android:inputType="number", Also it wont allow any other special characters too...

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?

Why responsive email works well on litmus test, but broken after sending it

I am testing a responsive email template named "Sidebar Hero" provided by ink, here's the link.
And when I test it at litmus, the screenshots at android and apple show that responsive works great as expected. Here's my test's screenshots: android4.0, and iPhone. You can check others android and iPhone aside.
But when I sent it from client(like thunderbird, outlook), the responsive broken. The email looks like a mess. Here's the scrrenshot:
How code was produced:
I download the template code directly from template page, and then use inliner tool provided by Ink too to make style inline. And then nothing. Everything done. In case you need my code
What I miss Or Any unaware mistakes that I make?
Anyone can help. Thanks very much !
Are you sending it through a corporate MS Exchange network? Sounds similar to an issue I had a while ago where the Exchange server at my work was stripping my media queries. Maybe try sending to a different email address on a different non-corporate domain to see if it makes a difference.
Having a similar issue...
In the docs it recommends using the Block grid for Gmail (Mobile, iOS, Android) because it is still flexible without using media queries. Also check out the compatability table right above the "Sub Grid" header.
Apparently the main caveat for using the block grid instead of the default one is:
"Make sure that there isn't any whitespace between your elements, otherwise Thunderbird will add a gap between your block-grid elements."
For floating two columns on top of each other ink template it's using column splitting instead of table aligning.
An issue that I found regarding this method is that display-block or float:left on "td" is not working for some android versions because the Doctype gets stripped.
The solution is to use "th" instead of "td" and to make sure to override the font-weight and align for "th", cause by default it's bold and center.

How to change Android Talkback in case of App name

The App I am working on has a name which is mispronounced by the talkback. I am able to fix this within the app by changing the spelling. But if I change the spelling in the android:label in the manifest, it is misspelled on the app icon on the phone. Does anyone have a way around this?
There is no way to do this. The fix would be for the LaunchScreen to have the ability to read an alternative label, and place it in the content description for the textView that represents your application.
TalkBack reads back things like this.
If a contentDescription is available this is read off.
If the view has "text" this is read off.
All other cases the view is not accessibility focused.
So, what is happening is TalkBack is grabbing onto the "text" of your view as provided by the name of the application. The Launch Screen does not provide a mechanism for overriding the contentDescription, and therefore will only ever read your text. This isn't a problem with your app, it is a problem with the Home Screen app. You may be able to fix this for users with different Home Screen apps, but there is absolutely no universal solution, and certainly no solution for the standard LaunchScreen application provided on stock Motorola, Samsung, and Nexus devices (most likely others as well, but I don't own any of them).
In the case that talkback is not pronouncing an acronym correctly, attempting to read it as a word rather than individual letters, you can use zero-width non-breaking space characters \ufeff to separate the letters invisibly.
Suppose you have the word CAT but you want it pronounced C.A.T.:
<string name="app_name">C\ufeffA\ufeffT</string>
It will still appear as CAT and won't be broken for line-wrapping.
However, your users will not be able to search for the app by typing CAT anymore.
You could change the text read by TalkBack programmatically with:
getWindow().getDecorView().setContentDescription("Name as pronounced")

Categories

Resources