Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old April 18th, 2010, 02:55 PM   #1 (permalink)
New Member
 
Join Date: Apr 2010
Posts: 3
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default To popup Numeric Keypad instead of Default Keypad | HTML code

Hi

I have an HTML/JSP page which is supposed to run on Android phone.
Theres an Amount field, clicking on should pop up the Numeric Keypad
instead of Default keypad.


I am not able to find the code(HTML code) which should by-default bring the
numeric keypad.

I tried
<input android:inputType="phone" name="amount" value="1.00"
maxlength="9" class="formField"/>

it does not work..

please help

shibdutta is offline  
Reply With Quote
Sponsors
Old April 18th, 2010, 03:52 PM   #2 (permalink)
Senior Member
 
KlaymenDK's Avatar
 
Join Date: May 2009
Location: Denmark
Posts: 1,215
 
Device(s): HTC Desire Z (rooted, CyanogenMod v7.1; Revoked ClockworkMod) HTC Desire (rooted, Oxygen rom; Revoke
Thanks: 29
Thanked 127 Times in 98 Posts
Default

Welcome to the forum!

I presume you mean XML and not HTML? It's not very difficult.

Androidblogger describes that:
Quote:
I found that a numeric editText ( or a textView) is done with this XML tag:
Quote:
android:numeric="decimal"
Then I found that limiting the number of character is also very simple :
Quote:
android:maxLength="10"
and that's all !
Also from Lost Droid:
Quote:
I recently spent some time trying to figure out how get the Soft Keyboard to default to numeric input when I only required numbers entering. It’s actually quite simple but took awhile to figure out. All you have to do is add the ‘android:inputType’ to the EditText resource element. You can then add numberDecimal for numbers with decimal places or number if no decimal places are required.
Quote:
<EditText android:text=""
android:id="@+id/editReading"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="numberDecimal">
</EditText>
PS. I've deleted your other post because:
- it was a double post, essentially same content as this one, and
- it was listed in the "apps" forum, this "devs" forum is more appropriate.
Don't let this subtract the feeling of welcomness to the forum!
__________________
Don't forget to hit the "Thanks" button when someone helps you!!!
How To Ask Questions The Smart Way
-- 010\001\111 --
KlaymenDK is offline  
Last edited by KlaymenDK; April 18th, 2010 at 03:55 PM.
Reply With Quote
Old April 18th, 2010, 04:16 PM   #3 (permalink)
New Member
 
Join Date: Apr 2010
Posts: 3
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Surprised To popup Numeric Keypad instead of Default Keypad | HTML code

Thank you for your reply.

actually i meant HTML. So I have a webpage that has an Amount field in it. What i am looking for is that, when a user clicks on the text box, the numeric keypad should come up instead of default keypad.

I think your solution is for Android Application not for Web Pages which will be viewed on an Andriod Browser.


Regards
Shib
shibdutta is offline  
Reply With Quote
Old April 19th, 2010, 03:07 AM   #4 (permalink)
Senior Member
 
KlaymenDK's Avatar
 
Join Date: May 2009
Location: Denmark
Posts: 1,215
 
Device(s): HTC Desire Z (rooted, CyanogenMod v7.1; Revoked ClockworkMod) HTC Desire (rooted, Oxygen rom; Revoke
Thanks: 29
Thanked 127 Times in 98 Posts
Default

Oh I see, I misunderstood you then. I don't think there's any way to specify what you're looking for.

I mean, you can apply (script-based) data-entry limitations to your web page, but I don't think you can have the web page tell the client what kind of keyboard layout should be used. I'm sure CSS can't help you there, and I doubt if even HTML5 has a hook for that (and even if it did, I don't think the Android browser would be able to handle it).

The web is too old to know about virtual keyboards!
KlaymenDK is offline  
Reply With Quote
Old April 19th, 2010, 08:44 AM   #5 (permalink)
New Member
 
Join Date: Apr 2010
Posts: 3
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default Android should be smart

ya, Web is not yet smart enough.

But i have done similar kind of thing for iPhone browser, by changing the Type of the field to type="number" (instead of "text"). So just by changing the Type of the TAG iPhone browser is able to recognise that it needs to display the Numeric keypad.

I was looking for something similar for Android . i believe Android is smart enough

Regards
Shib
shibdutta is offline  
Reply With Quote
Old April 19th, 2010, 10:31 AM   #6 (permalink)
New Member
 
Join Date: Apr 2010
Posts: 1
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am looking for a solution for this challenge as well. Was able to do this for iPhone as mentioned above, but can't find anything on how to do this for Android.

Thanks for your help!
Trixor is offline  
Reply With Quote
Old April 19th, 2010, 04:41 PM   #7 (permalink)
Senior Member
 
KlaymenDK's Avatar
 
Join Date: May 2009
Location: Denmark
Posts: 1,215
 
Device(s): HTC Desire Z (rooted, CyanogenMod v7.1; Revoked ClockworkMod) HTC Desire (rooted, Oxygen rom; Revoke
Thanks: 29
Thanked 127 Times in 98 Posts
Default

Quote:
Originally Posted by shibdutta View Post
i believe Android is smart enough
I believe you are being overly optimistic.

Hey, try some other Android browsers: Dolphin, Opera, Firefox...
KlaymenDK is offline  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Numeric Keypad - Link to Laptop RudeandRude Android Applications 3 January 5th, 2011 07:56 PM
EditText - getting the 10 key numeric virtual keypad Armaced Application Development 3 September 9th, 2010 05:40 PM
Support numeric keypad available ("2/abc, 3/def...") Turkoes Sony Ericsson Xperia X10 5 July 22nd, 2010 03:29 PM
Need code of Numeric Soft keypad in android HTC mrmcs Application Development 0 January 5th, 2010 05:57 AM



All times are GMT -5. The time now is 12:18 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo