Translate text


Use some translation engine to translate a text and return the result.


public void startTranslateText(String text, String from, String to) {
    Intent intent = new Intent("org.openintents.action.TRANSLATE"); 
    intent.putExtra("android.intent.extra.TEXT", text); // String
    intent.putExtra("org.openintents.extra.FROM_LANGUAGE", from); // String
    intent.putExtra("org.openintents.extra.TO_LANGUAGE", to); // String
    if (intent.resolveActivity(getPackageManager()) != null) { 
      startActivityForResult(intent, REQUEST_CODE);

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) { 
      String translatedText = data.getStringExtra(android.intent.extra.TEXT);
      // handle result

Example intent filter

<activity ...>
        <action android:name="org.openintents.action.TRANSLATE" />
        <category android:name="android.intent.category.DEFAULT" />

Apps Providing an Implementation

Search on Github

Search on Google Play, AppBrain, Amazon App store or similar (not yet available - please make this happen!)

For Specification Writers

Edit on Github