Android Open Source - book Translate Word Task






From Project

Back to project page book.

License

The source code is released under:

MIT License

If you think the Android project book listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package translator;
/*from   w w  w  . j  a  v  a 2  s.c  o  m*/
import android.os.AsyncTask;

import com.memetix.mst.language.Language;
import com.memetix.mst.translate.Translate;

/*
 * 
 *     async task for translating the words..
 * 
 */
public class TranslateWordTask extends AsyncTask<Object, Object, Object> {
  // bingbong-ids, these are very secret
  private final String id = "jy03189211";
  private final String key = "metropoliasanapickup";  
  
  public TranslateWordTask(){
    super();
      Translate.setClientId(id);
      Translate.setClientSecret(key);    
  }
  
  @Override
  protected Object doInBackground(Object... words) {
      
    String word = (String) words[0];
        
    try {      
      String translatedText = Translate.execute(word, Language.FINNISH, Language.ENGLISH);
      return translatedText;
    } catch (Exception e) {
      return null;
    }
    
  }
}




Java Source Code List

book.BookListAdapter.java
book.Book.java
book.ExpandableListAdapter.java
book.SelectableWordListAdapter.java
com.BookTable.java
com.Db.java
com.TranslationsTable.java
com.WordTable.java
fragments.BookListFragment.java
fragments.BookViewFragment.java
fragments.CameraFragment.java
fragments.EditBookFragment.java
fragments.PageAdapter.java
fragments.PagerActivity.java
translator.TranslateWordTask.java
translator.Translator.java