How to programmatically get current keyboard language on an Android device

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);

InputMethodSubtype ims = imm.getCurrentInputMethodSubtype();

String locale = ims.getLocale();

You can try this code to get Current Keyboard Language regional code.


It is possible

imm.getCurrentInputMethodSubtype();

to return you null value. In this case you should check language of android system like this

Locale.getDefault().getLanguage()        ---> en     

otherwise you will receive NullPointerException