[英]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.