java - Transliteration with Android -
i want transliterate (not translate!) text arbitrary (as far possible) languages english in android app. there built-in way?
i've found https://android.googlesource.com/platform/libcore/+/master/luni/src/main/java/libcore/icu/transliterator.java doesn't seem available default (at least ide doesn't find it). need add code, suggested comment in where can jar import libcore.io??
alternately, add icu4j dependencies , follow icu4j cyrillic latin. large dependency (though proguard should help).
finally, add transliteration cyrillic myself , wait until/if needs other languages (with obvious drawbacks).
under hood, android has of icu4j available under android.icu, subset exposed public api. if want use class isn't exposed, can write code uses class , should work fine. however, doing not technically supported, there version of android somewhere doesn't have class whatever reason , causes code break. (this unlikely happen in practice, possible nonetheless.)
note: namespace android.icu added in android 7 nougat, may or may not usable yet depending on version of android targeting.
Comments
Post a Comment