Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use google translation API on Android?

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?

like image 655
Jakobovski Avatar asked Sep 05 '18 17:09

Jakobovski


People also ask

Can I use Google Translate API for free?

The Google Translate API is not free. Its pricing is based off monthly usage in terms of millions of characters. It costs $20 per 1 million characters for translation or language detection. Price is per character sent to the API for processing, including whitespace characters.

Is there a Google Translate app for Android?

You can translate text, handwriting, photos, and speech in over 100 languages with the Google Translate app. You can also use Translate on the web.


1 Answers

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

  • Translating text using Google Cloud Translation API
  • Only one short class thus Easy to use and understand

َ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.

like image 197
Saeed Avatar answered Oct 07 '22 14:10

Saeed