How to add a specific key on android keyboard - android

I've used android:inputType="numberDecimal" on my edittext.
I want to show / key on that keyboard.
for example i want to enter 1/2 instead of 0.5.
is it possible on android?

just try like this
<EditText
android:id="#+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:digits="0123456789/.-">
</EditText>

Yes it is possible but you make custom keyboard.

Related

Hide letters in andoird's numerical keyboard

Is it possible to hide the letters in the numerical keyboard ?
Just like this guy asked for iOS, but on Android : Show numeric keyboard without letters
Yes..,,you can use inputType as number
<EditText
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number" >
</EditText>
Output
Solution 2
android:inputType="phone"
android:digits="0123456789"
Just declare the input type as number on whatever widget you need it on
android:inputType="number"

inputType = "number|text" not working - Android

I am using inputType = "number|text" inside TextInputEditText when I focus on this, It lets me type number only, It allows to navigate to text keyboard but not letting me type text.
Here is the code snippet:
<android.support.design.widget.TextInputLayout
android:id="#+id/availableRoof"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/radio_groupPcOfInstltion"
android:visibility="visible">
<android.support.design.widget.TextInputEditText
android:id="#+id/avlbleRoofTextField"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Available Roof/Ground Area(sq.ft.)"
android:inputType="number|text"
android:text=""
android:textSize="13sp" />
</android.support.design.widget.TextInputLayout>
Please suggest a solution, so that I can type text and number both.
Just use input type text for getting the all possible options and textVisiblePassword for removing the suggestion and show number in one keyboard.
android:inputType="text"
OR
android:inputType="textVisiblePassword"
You need to set the inputType as text, so that you can easily enter text as well as numbers in the TextInputEditText.
Use: android:inputType="text"
Try adding these properties:
android:digits="abcdefghijklmnopqrstuvwxyz1234567890"
android:inputType="textVisiblePassword"

Add numeric keyboard in android

It's possible to set or add numeric keyboard without +, -, . sign in android app?
I want only 0-9, backspace and enter keys?
I tried with
inputType="number"
setRawInputType(InputType.TYPE_CLASS_NUMBER)
but it doesn't work.
Try to add this line on your code:
input.setRawInputType(Configuration.KEYBOARD_12KEY);
this will show only the numeric keyboard.
android:inputType="number"
Just use this line your XML file
For Example In my Edit Text
<EditText
android:id="#+id/edtMobileNo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/btnSignup"
android:layout_centerVertical="true"
android:background="#drawable/background_edittext"
android:drawableLeft="#drawable/username_icon"
android:hint="#string/mobile_no_hint"
android:inputType="number"
android:maxLength="10"
/>

How to get a pin number password keyboard in android?

I need a number keyboard on a PIN EditText. I tried using
android:inputType="number|textPassword"
This brings up the number keypad, but the characters are not password chars.
How to get a number keypad that shows password chars in EditText view?
The app runs on 2.2 and above.
You should have a look here:
Edittext set for password with phone number input? (android)
It states that
android:password is deprecated, but is the only way because android:inputType="phone|textPassword" is ignored ...
<EditText
android:id="#+id/EditText01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:password="true"
android:inputType="phone"
/>
In my styles.xml, these two seem to work for me:
<item name="android:inputType">numberPassword</item>
<item name="android:password">true</item>
This works:
<EditText
android:id="#+id/pinEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:digits="1234567890"
android:inputType="textPassword"
android:maxLength="4" >
<requestFocus />
</EditText>
If digits will work for you.
EDIT: Ah, I see, it doesn't bring up the number keypad....back to the drawing board.
Use : "numberSigned|numberPassword"

Android: How to implement numeric keypad?

I have an edit text with a background image. When i click on the edit text i should enter numericals.
So, I should dispaly a numeric keypad. I did this by android: inputtype = "Phone" method. But iam not getting numeric keypad. Please help me>?
for this You need to set the EditText's Input type property to number .
android:inputType="number"
you have two solutions for that
the 1st one is to do it in the layout like that android:inputType=""... see below lastline:
<EditText android:id="#+id/getLat"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:cursorVisible="true"
android:editable="true"
android:singleLine="true"
android:layout_weight="1"
android:inputType="numberDecimal"
/>
use this..
editview.setInputType(InputType.TYPE_CLASS_NUMBER);
Best
V.k

Categories

Resources