2

I´ve registered for Google Cloud Services and activated the Google Cloud Translation API. Now I want to start an Android Studio Project, using this API. In the documentation they refer to Import the following librarys:

import com.google.cloud.translate.Translate;
import com.google.cloud.translate.Translate.TranslateOption;
import com.google.cloud.translate.TranslateOptions;
import com.google.cloud.translate.Translation;

How to get these librarys for Java/Android Studio?

https://cloud.google.com/translate/docs/reference/libraries

On this page under 'Installing the client library' one can not find something for Java.

So how to use this API in Android Studio?

J. Hock
  • 125
  • 1
  • 11
  • 2
    Check this https://stackoverflow.com/questions/22829657/how-to-use-google-translate-api-in-my-android-app – Ninja Nov 22 '17 at 09:39
  • 1
    compile 'com.google.cloud:google-cloud-translate:1.12.0' put this in your app gradle and sync project – Payal Sorathiya Nov 22 '17 at 09:43
  • thank you Sorathiya. When I try to compile my Project now I´m getting an annotation processor Error:Execution failed for task ':app:javaPreCompileDebug'. > Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration. - auto-value-1.2.jar (com.google.auto.value:auto-value:1.2) any ideas? – J. Hock Nov 22 '17 at 10:11

1 Answers1

1

putting

dependencies {
...
compile 'com.google.cloud:google-cloud-translate:1.12.0'
} 

into my build.gradle solved the problem.

J. Hock
  • 125
  • 1
  • 11