How to implement the google wallet keyboard - android

I want to implement the keyboard of google wallet. Anyone know how to do that. The keyboard is on the page. Not the system default keyboard. Thank you Or how can I draw a keyboard?
this Link Android custom numeric keyboard will help you figure this problem

You can easily see how Google implemented the keyboard by downloading the Google Wallet APK (or by rooting your phone and pulling the APK off) and unpacking/decompiling it with your tool of choice (e.g. Procyon, CFR, JD, etc.). I can only speculate, but I think they did this to minimize the possibility of a third-party keyboard app logging the input, and so that they can "shred" the PIN in memory as soon as it has been used.
The keypad is just a bunch of buttons laid out as a table/grid, and the buttons are customized to have the subscript effect (i.e. 2ABC) using SpannableStrings.
After decompiling, you can find what you're interested in by looking at the com.google.android.apps.wallet.pin package, specifically the PinButton class. Also, look at the /res/layout/pin_view.xml layout and its includes (pin_fields.xml and pin_pad.xml).

Related

How do you make an in app button keyboard in an activity?

How can you make an in-app buttons that works like the keyboard?
I am trying to load a website(which is coded using javascript) into my app using the webView function. But unfortunately, the interactive design of the website requires the user to type in letters from the computer keyboard. I could easily pull up the keyboard on the android device to type, but it is a bit too inconvenient as I only need to use 5 buttons.
I used Kotlin to try inserting a letter to the webView browser, but I can't find a solution just yet. Is there a way to make a shortcut or a set of a library that allows me to do so? Thank you for your replies.
You'll need to dispatch KeyEvents to the WebView. For example, the following code simulates a left key press.
webView.dispatchKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_LEFT))
Here's an article for further reference. The list of possible KeyEvent codes is available in the official docs.

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?

How to make a Emoticon Keyboard

I am trying to develop a emoticon keyboard for Android. I would like for the user to be able to purchase the app and install the emoticons to use with their keyboard for text and social networking my emoticons are graphics would I have to create a softkeyboard? how can I go about making this app any source codes advice would be appreciated I am new to app development its nothing like web..PLEASE HELP!!
I am trying to develop a emoticon keyboard for Android
Please bear in mind that most people do not speak exclusively in emoticons. Either you will need to create a full natural-language soft keyboard that also has emoticons, or users will have to flip back and forth between their regular soft keyboard and yours. The latter seems unlikely to be popular.
would I have to create a softkeyboard?
You are asking to create a soft keyboard.
how can I go about making this app
There is a SoftKeyboard sample app in your SDK that you can use as a starting point. Beyond that, search for tutorials on how to create an InputMethodService.

Making Google TV into a public kiosk

I am working on a project where we have to put a Google TV in a public area. I am building a custom application for it that should be running all the time. Basically, we don't want someone to be able to switch out of this specific application. In a perfect world, people walking by should be able to use a keyboard that comes with the Google TV (Revue). My question is, is there a way to programmatically lock down the system? Or do we need to use a special keyboard that only has alphanumeric buttons on it?
I am not an expert in Google TV,but such a problem can be handled in the mobile by creating a Home application and making that as default.So the user cannot switch out the application.Of course you need to make sure that your app is the default Home app before giving it out to the user(anyways this is your device and not the users). I am not sure whether the Google TV has a home intent.
My question is, is there a way to diagrammatically lock down the system?
Not without creating your own custom firmware, which at the moment is not possible for Google TV IIRC.
Or do we need to use a special keyboard that only has alphanumeric buttons on it?
Not only do you need that, but you would have to get one that works with the device (not sure if a standard Bluetooth keyboard will work), and then you will run into problems with missing buttons like BACK and MENU. You might be able to engineer around those missing buttons by having adequate navigation in the app to avoid users needing them.

Custom 'Keyboard' built in an application on Android

I've been looking to create a custom keyboard for my application. At first, I started to look at the SoftKeyboard for the SDK examples, but reading the Android Developer Group led me to this post:
This is really not how the input
method framework is supposed to work.
An IME should be a generic input
facility, not for a particular
application. If you need some
app-specific input, you should build
it into your UI rather than pushing
it out to a generic IME.
How do I build an app-specific input within the UI? I mean, is there a way to extend the Keyboard app or something and use it only in my application?
Features needed for the keyboard:
Shift key to display some other keys
Special keys like square root or PI
etc.
PS: an ugly solution could be to make a table of ImageButton for example, but I wanted to make something clean.
I'm not really sure if there's a straight-forward solution to this (to that extent that it is even possible to understand the real reason behind the original question).
As is quoted in the original question:
If you need some app-specific input, you should build it into your UI
rather than pushing it out to a generic IME.
What is meant by that, is not that you within your app should try to build in such input features by extending or modifying the soft keyboard on the phone. There are so many different soft keyboards (and basically, the soft keyboard is just another app), since most phone manufacturers create their own version, and people download 3rd party keyboards (such as Swype or SwiftKey etc.), and I can't picture there being a way for you to "hack" into those to add a few buttons or whatever it is you want (which could also be a major security hole, another reason why it probably isn't possible).
What instead the above quote suggests, is that you have to create some other form of input besides the keyboard. One such example, and a very good one if I might add, is how the RealCalc Scientific Calculator looks:
Now this isn't open source, so I can only guess how the code looks like (but it shouldn't be too hard a guess either): in its simplest form, this is just a grid with lots of buttons. Each button handles the onClick event, which would mean performing some kind of action (changing the label on some other buttons, showing a menu, displaying some text in the upper label or whatever), and that's probably pretty much what's to it. And of course, the phone's soft keyboard is never displayed (since you don't need a keyboard with all those buttons (and also there aren't any input fields to write anything in)).
It all boils down to the already mentioned quote: If you need some app-specific input, you should build it into your UI. Or in other words: create buttons (and don't display the soft keyboard if you don't need it) and make things happen when you click them.
And just to have mentioned it: if you do want to create your own IME (which I strongly believe is not the case here), you should have a look at the following resources:
Onscreen Input Methods
Creating an Input Method
Soft Keyboard sample
In my humble opinion you should take a look at the beginning of reference about keyboard and keyboard view http://developer.android.com/reference/android/inputmethodservice/Keyboard.html and http://developer.android.com/reference/android/inputmethodservice/KeyboardView.html.
There you can see an example of defining keyboard using XML file. I think that this is what you are looking for.
As mentioned by #sebap123
Keyboard and KeyboardView class are the one you need to use,
Further, for Implementation, here is a quick detailed guide.

Categories

Resources