Android system facilitate an on-screen keyboard, known as a soft keyboard input method, when a text field in your UI receives focus. However with the soft keyboard being visible on the screen, it will sometimes clutter the layout.
- Specify the input method type
Based on the Android guide, we should always declare the input method for your text fields by adding the android:inputType
attribute to the <EditText>
element.
For example, here is the soft keyboard that will appear when we use the "phone"
value:

And here is the soft keyboard that will appear when we use "textPersonName"
as value

We can also customize the input type to provide auto spelling correction with the "textAutoCorrect"
value. Android system also provide solution if we want to implement auto complete suggestion to our text field.
2. Add android:windowsSoftInputMode="adjustResize"
When the soft keyboard appear it might reduce the space in UI layout and might clutter it.
For example, observe this layout bellow shown on MainActivity :

When user tried to input data on Type of Item field, soft keyboard will appear and top component of this layout will not be visible anymore.

One of the solution is to add android:windowsSoftInputMode="adjustResize"
attributes on its activity manifest. Based on Android documentation, this attributes will ensure system to resize the layout based on the available space. Here is the layout will look like after adding the attribute.

3. Use SOFT_INPUT_ADJUST_PAN
When there is not enough space available on the layout, clutter as bellow example also will happen

The solution for this error is to implement getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
on Activity class.
Based on Android documentation, SOFT_INPUT_ADJUST_PAN
Adjustment option for softInputMode
: set to have a window pan when an input method is shown, so it doesn't need to deal with resizing but just panned by the framework to ensure the current input focus is visible.
The soft keyboard will only appear under EditText field which the user focus in.

This is what I learned about Soft Keyboard input from doing my recent task. Please give me a clap if this writing helps you on this subject.