'Never display SoftKeyboard on Android

I am trying to write an Android app, which shouldn't let users use SoftKeyboard. Because, I want users to scan barcodes to input into editText. I don't want SoftKeyboard to show up.

I read many articles and pages on Stack-overflow, and all suggest me to use the below line

android:windowSoftInputMode="stateAlwaysHidden"

But, the above line doesn't block users to the SoftKeyboard, users can still use the SoftKeyboard.

What is the best way to block users to use SoftKeyboard once and for all?

Regards



Solution 1:[1]

This might help if you want to block focus on your editText.

android:focusableInTouchMode="true"
android:cursorVisible="false"
android:focusable="false"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 prashantwosti