I am changing the application locale based on user choice. Independent of device locale.
using
public void setDefaultLocale(Context context, String
I am absolutely unsure how portable this is to different devices:
try {
Process exec = Runtime.getRuntime().exec(new String[]{"getprop", "persist.sys.language"});
String locale = new BufferedReader(new InputStreamReader(exec.getInputStream())).readLine();
exec.destroy();
Log.e("", "Device locale: "+locale);
} catch (IOException e) {
e.printStackTrace();
}
And if you want the country part: persist.sys.country