Launching Google Translate Activity in Android and API TOS Question

422 views
Skip to first unread message

littleK

unread,
Aug 6, 2013, 9:24:52 AM8/6/13
to google-tra...@googlegroups.com
I was wondering if a Google employee could please respond to the following question?

I have developed an Android application that launches a Google Translate Activity using the following code:

...
Intent i = new Intent();
i.setAction(Intent.ACTION_VIEW);
i.putExtra("key_text_input", "What time is it?");
i.putExtra("key_text_output", "");
i.putExtra("key_language_from", "en");
i.putExtra("key_language_to", "es");
i.putExtra("key_suggest_translation", "");
i.putExtra("key_from_floating_window", false);
i.setComponent(new ComponentName("com.google.android.apps.translate",
"com.google.android.apps.translate.translation.TranslateActivity"));
startActivityForResult(i, 0);
...

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.i("yoyo", "in onActivityResult()");
// data is null
}

The parent onActivityResult() is called in my application from the Google Translate Activity, but data is null.  Therefore, I assume that there is no way to return any translated text from Google Translate back into my application.  Is this correct?  

Also, if there was a way to do this, would this be a violation of the API's terms of service?

Thanks!

Ilian Nikolov

unread,
Jan 13, 2014, 9:17:23 PM1/13/14
to google-tra...@googlegroups.com
littleK, have you had any success returning a translation from the mobile Translate application? With the option for dictionary download for offline use, this seems like a particularly interesting.
Reply all
Reply to author
Forward
0 new messages