title: Google translate api on android gives error 'GoogleJsonResponseException: 400 Bad Request'
body: <p>When trying to access google translate api from an android application it gives the following error: </p>
  
  <pre><code>java.lang.RuntimeException: An error occurred while executing doInBackground()
  ....
  Caused by: com.google.cloud.translate.TranslateException: Invalid Value
  ...
  Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
  {
  "code" : 400,
  "errors" : [ {
  "domain" : "global",
  "message" : "Invalid Value",
  "reason" : "invalid"
  } ],
  "message" : "Invalid Value"
  </code></pre>
  
  <p>The code inside doInBackground method() is:</p>
  
  <pre><code> Translate translate = TranslateOptions.newBuilder()
                  .setApiKey("myAPI_key").build().getService();
  
          Translation translation = translate.translate(
                  params[0],
                  Translate.TranslateOption.sourceLanguage("en"),
                  Translate.TranslateOption.targetLanguage("al"));
  
  
          return translation.getTranslatedText();                                                }
  </code></pre>
  
  <p>The string I pass is in english. Can anyone help me figuring out this error? 
   Thanks in advance.</p>