|
Project Information
Featured
Downloads
Links
|
This project provides a simple API to use Google Translate in JavaME (J2ME) platform. It uses the Google AJAX Language API to do the translation via a HTTP connection. News Version 2.0 is now available. It supports 'Auto-Detect Language' feature (implemented by Kamil MyĆliwiec) Requirements CLDC-1.1 MIDP-1.0 Install Simply include the google-api-translate-javame.jar file in your application's classpath. Quickstart See the example midlet. import com.google.api.javame.*;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.TextBox;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
public class TestMidlet1 extends MIDlet {
private TextBox tb;
public void startApp() {
tb = new TextBox("Google Translate API for JavaME", "", 500, TextField.ANY);
try {
String translatedText = Translate.translate("How are you", Language.ENGLISH, Language.FRENCH);
tb.setString(translatedText);
Display.getDisplay(this).setCurrent(tb);
} catch (Exception e) {
}
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}Features More than 40 supported languages For more features about Google Translate API visit - http://code.google.com/apis/ajaxlanguage/ Acknowledgment I would like to thank 'Rich Midwinter' who is the project owner of google-api-translate-java which is build for JavaSE. His work helped me alot in completing this project. Problems / Suggestions? Please do report an issue if you find any bugs or have any feature requests. |