Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I know keyboard language? (en/fr)

Tags:

android

I develop an sms sender app and I wanna know language that user uses. so, when user types a message how can I know language that he/she uses?

like image 761
NrNazifi Avatar asked Feb 08 '13 14:02

NrNazifi


1 Answers

get the input type manager by using:

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

then , choose what to get from it using the next methods :

http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html#getCurrentInputMethodSubtype%28%29

or: http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html#getLastInputMethodSubtype()

together with this to get the locale of the input type:

http://developer.android.com/reference/android/view/inputmethod/InputMethodSubtype.html#getLocale()

like image 53
android developer Avatar answered Sep 25 '22 07:09

android developer