What is Google Translation Service?
Google Translate is a free automatic translator. It works
without the intervention of human translators, using state-of-the-art
technology instead. Google Translate currently supports translation between 57
languages.
How-To use Google Translate API in Android?
Using simple library google-api-translate-java[[http://code.google.com/p/google-api-translate-java/]], we can implement google translation with few lines of code.
Using simple library google-api-translate-java[[http://code.google.com/p/google-api-translate-java/]], we can implement google translation with few lines of code.
Steps For integrating google translate api in
android app.:
1:)First download jar file from [[http://code.google.com/p/google-api-translate-java/downloads/detail?name=google-api-translate-java-0.95.jar&can=2&q=]]
and add it to project's build path.
2:)After importing library,you can easily translate text
by simple code described below:
Translate.setHttpReferrer("www.example.com");//here
you can use any valid url.It's just for google to know who is consuming their
service
String
translatedText=null;
try {
translatedText
= Translate.execute("How are you", Language.ENGLISH,
Language.FRENCH);//here You have to pass text to translate,language of you test
and language to translate respectively.
} catch
(Exception e) {
e.printStackTrace();
}
very nice
ReplyDeletei have downloaded the api.. how to use it with my eclipse.?
ReplyDeleteUse in your Activity class as per given Code
DeleteI want the example project, please....
ReplyDeletecheck http://code.google.com/p/google-api-translate-java/
ReplyDeleteI am getting "Error retrieving translation" error.....What i have to do futher?
ReplyDeleteCode doesn't work. please give full project
ReplyDelete