views:

68

answers:

1

I posted a question earlier today which was well answered by commonsware. I wanted a numeric keypad that had a go or done button that closed and executed a calculation class. Thanks to a tip from commonware on where to start I got this working beautifully on the emulator. Then I came to load it on to my HTC desire for testing and it doesn't work at all. I'm sure it must be because of HTC sense having it's own ime but there must surely be a way to make this work on HTC phones? Anyone else managed to get around this issue?

+1  A: 

I can replicate what I think you are seeing on the HTC Incredible.

Not all soft keyboards will support the IME action button. Some, like the Graffiti soft "keyboard", may have no buttons at all, let alone an IME action button. Even the Compatibility Definition Document says nothing about requiring such an action button for the keyboards supplied with a device.

Hence, you should not rely on the IME action button. If it is there, users can use it. However, always have some other means of accomplishing whatever your goal is.

CommonsWare
so aree you saying my best approach is to create my own keyboard, not an IME but a view? I did have a calculate button at one point but it was covered by the keyboard. It's annoying as the action key on the HTC keyboard goes green when it's set to type GO which is great so it understands that much it just returns 0 in the actionid. Im beginning to think creating a little keyboard myself is the way to go but was trying to avoid it? Is that the best approach? Is there any documentation on Android best practice that is acutally readable?
Dream Architect
Oh I've subscribed finally by the way. wish I could afford to attend one of your courses in London, would be quite useful. sadly I'm trying to learn Java and android at the same time by trial and error
Dream Architect
@Dream Architect: "so aree you saying my best approach is to create my own keyboard, not an IME but a view?" -- for an ordinary application, you'd just have the action button equivalent as part of the activity. For a calculator, you are going to need other "keys" anyway (+, -, *, /, etc.), and so you probably need your own button panel. In that case, I'd put the number keys in that button panel, like a regular calculator has them.
CommonsWare
Maybe I'm coming at this the wrong way then. It's not a calculator in that sense. It's a program that requires three numeric inputs to be completed then it executes some specific engineering calculations. The iphone version executes this when the go button is pressed on the keyboard so I was trying to mimic that. I did have a calculate button but it go hidden by the keyboard. I'm sure there is a way around the latter though.
Dream Architect
@Dream Architect: Ah, OK. Well, you can still "mimic" the "go button", but you will need an alternative means. The user can get back to the calculate button by pressing BACK to close the soft keyboard. Or, you could move the calculate button elsewhere on the screen. Or, you could wrap the whole form in a `ScrollView` so the user can scroll down, even with the soft keyboard exposed, to get to the calculate button. Lot of possibilities here, just depends on your particular GUI design.
CommonsWare
ok thats great, it gives me somewhere to start at least, I have considered moving the calc button though I'm working with the iphone images so they are a fixed layout in that sense. I'll see what I can come up with anyway. I think I'll get the rest of the functoinality working and come back to this. Thanks again for your help
Dream Architect