I am trying to use the google translate API in an an andriod app. Unfortunately I can not find a reasonable way to do this as google cloud java client does not currently support andriod!
What is the preferred way to do this?
I am trying to use the google translate API in an an andriod app. Unfortunately I can not find a reasonable way to do this as google cloud java client does not currently support andriod!
What is the preferred way to do this?
Please see this link
How it works?
It takes three parameters, the text which will be translated, the source language and the target language. It performs the translation in background and returns a string with the result
Features
َAn Example:
GoogleTranslate googleTranslate = new GoogleTranslate();
// Perform the translation by invoking the execute method, but first save the result in a String.
// The second parameter is the source language, the third is the terget language
String result = googleTranslate.execute("the text to be translated", "en", "de").get();
UPDATE:
Also checkout this documentation and in github.
Hope it will be help you.
The Cloud Translation API is exposed as a REST API, as shown in the documentation, so you can just use it with your favourite Android HTTP library.
You can also try out Phrase Phrase provides a way to translate user-generated content to the desired target language using different translation engines or options of your choice.