Can I read languages supported by an android without rooting it? -


can read languages android device supports? know can read current language, want read languages.

afaik, it's there in system/fonts. can access without rooting device?

edit: tried locale on moto-g , list contains gujarati language, seems because v. 5.0.2 supports language, device not support gujarati font. need know fonts supported on particular device, can decide whether render them.

this worked me!

public void checksupportedfonts() {      mlanguagefonts = new hashmap<string, string>();      mlanguagefonts.put("en-us", "ab");     mlanguagefonts.put("hi-in", "अआ");     mlanguagefonts.put("bn-in", "অআ");     mlanguagefonts.put("gu-in", "અઆ");     mlanguagefonts.put("mr-in", "अआ");     mlanguagefonts.put("ta-in", "அஆ");     mlanguagefonts.put("te-in", "అఆ");     mlanguagefonts.put("kn-in", "ಅಆ");     mlanguagefonts.put("ml-in", "അആ");      iterator<entry<string, string>> languageiterator = mlanguagefonts.entryset().iterator();     while (languageiterator.hasnext()) {         map.entry<string, string> pair = (entry<string, string>)languageiterator.next();         string font = pair.getvalue().tostring();          if(issupported(font))             log.d(tag, "language supported : " + pair.getkey());         else             log.d(tag, "language unsupported : " + pair.getkey());         } }  private boolean issupported(string text)  {      string char1 = text.substring(0, 1);     text = text.substring(1, 2);     bitmap bitmap1 = generatebitmap(context, char1);     bitmap bitmap2 = generatebitmap(context, text);     boolean res = !bitmap1.sameas(bitmap2);     bitmap1.recycle();     bitmap2.recycle();     return res; } 

Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -