Android google translate API

I am having trouble getting a transfer from Google via the transfer API. Does anyone know what is wrong? Thanks!

Note: It worked fine for some time, but maybe 5 months ago it stopped working.

@Override public void onClick(View v) { GoogleAPI.setHttpReferrer("http://code.google.com/p/google-api-translate-java/"); GoogleAPI.setKey("xxx"); try { tv_answer.setText(Translate.DEFAULT.execute(tv_source.getText().toString(), Language.CZECH, Language.ENGLISH)); } catch (GoogleAPIException e) { e.printStackTrace(); } } 

Received error:

 com.google.api.GoogleAPIException: java.lang.Exception: [google-api-translate-java] Error retrieving translation. 
+6
source share
2 answers

This problem only appears on android when using this api client. I believe this is due to the fact that this api client is outdated and / or poorly written.

You can try to get the source code here and fix the problem yourself or just use the api directly from Java using GET with HttpURLConnection and they parse JSON.

+1
source

The Google Translate API is a paid service.

Note:

( https://developers.google.com/translate/v2/getting_started )

0
source

All Articles