0

I know there is a few questions like this, but no one actually helped me. I would like to start using google translate API in my desktop app and set an API key directly in java code.

Is there any way to achieve this?

Thanks in advance

Chorizzo
  • 68
  • 1
  • 11
  • It's not clear whether your question is asking why it's *not* working when you're setting an environment variable, or how to get it to work without an environment variable. It would be helpful to focus on one or other of these (and maybe ask a different question for the other one). – Jon Skeet Mar 27 '18 at 11:54
  • @JonSkeet I hope it's better now :) – Chorizzo Mar 27 '18 at 12:17
  • Not really - because it's still not clear whether the problem is that what you've done doesn't work, or whether it's that you don't want to use an environment variable at all. – Jon Skeet Mar 27 '18 at 12:25

1 Answers1

0

There is a method in TranslateOptions.Builder class, although it is deprecated:

setApiKey method

There is some information though that may direct you to how to set this key. You probably can set a path to a file containing api key through setCredentials() method.

Hani
  • 21
  • 4