![](/img/trans.png)
[英]How to get Hindi Keyboard/translate into hindi text programatically in Android
[英]Translate English Text to Hindi in Android
I want to convert a text in English to Hindi and display it in the TextView.I followed the following URL http: //android-er.blogspot.com/2009/10/androidtranslate-using-google-translate.html but it dosen似乎不起作用。 有没有其他方法可以做到这一点?帮帮我。
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.read_view);
mTts = new TextToSpeech(this,this);
try {
setTranslate();
} catch (Exception e) {
e.printStackTrace();
}
}
private void setTranslate() throws Exception {
String OutputString = Translate.execute("hello",
Language.ENGLISH, Language.HINDI);
TextView tv = (TextView) findViewById(R.id.translate);
tv.setText(OutputString);
}
在这里,我试图在 TextView id "translate" 中显示印地语文本
Microsoft Bing Translator 为这种英语-印地语提供翻译器,并且对于有限的搜索完全免费。 http://www.microsoft.com/web/post/using-the-free-bing-translation-apis 。
确保您的应用程序确实具有Internet 权限
android.permission.INTERNET
添加谷歌翻译 api jar 即 google.api.translate-java-0.90.Z6145044DBF4329492
另请检查此客户端 api当您想轻松处理某些事件和请求时,它有时会很有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.