Back to project page book.
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.
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; } } }