DraKiNs

[PROJETO] Google Speak Mobile

Oct 30th, 2011
620
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.41 KB | None | 0 0
  1. /*================================================================
  2.          _ ____ _____ __ __
  3.         (_) _ \ ___ | _ _ | _ __ __ | \ / |
  4.         | | | _) / __ | | | / _ \ / _ `| | \ / | |
  5.         | | __ / \ __ \ | | __ / (_ | | | | |
  6.         |_|_| |___/ | _ | \ ___ | \ __,_|_| | _ |
  7.  
  8.             Criado por Bruno da Silva
  9.             www.ips-team.blogspot.com
  10.         Google Speak (Text to Speech Mobile)
  11.  
  12. ===============================================================*/
  13.  
  14. import java.io.*;
  15. import javax.microedition.midlet.*;
  16. import javax.microedition.io.*;
  17. import javax.microedition.lcdui.*;
  18.  
  19.  
  20. public class VisualMIDlet extends MIDlet implements CommandListener
  21. {
  22.  
  23.     private Display     display;
  24.     private TextField   textBeat;
  25.     private Form        formData;
  26.     private Command     comandoAcessar;
  27.  
  28.     public VisualMIDlet()
  29.     {
  30.         display = Display.getDisplay(this);
  31.     }
  32.  
  33.     public void startApp()
  34.     {
  35.         formData = new Form("Google Speak");
  36.         textBeat = new TextField("Digite sua frase", "", 50, TextField.ANY);
  37.         comandoAcessar = new Command("Falar", Command.OK, 0);
  38.        
  39.  
  40.         formData.append(textBeat);
  41.         formData.addCommand(comandoAcessar);
  42.         formData.setCommandListener(this);
  43.         display.setCurrent(formData);
  44.     }
  45.  
  46.     public void commandAction(Command c, Displayable d)
  47.     {
  48.  
  49.  
  50.         if(d == formData)
  51.         {
  52.             if(c == comandoAcessar)
  53.             {
  54.                 formData.append("Executando leitura de informacoes ..");
  55.                 formData.append("============================ \n");
  56.                 formData.append("Criado por Bruno da Silva");
  57.                 formData.append("Equipe [iPs]TeaM (c) \n\n");
  58.                 formData.append("Reconhecimento de Letras: Google Tradutor \n\n");
  59.                 formData.append("============================ \n");
  60.                 formData.append("www.ips-team.blogspot.com");
  61.                 formData.append("www.celularnokiac3.blogspot.com");
  62.                                
  63.                 try
  64.                 {
  65.                     Thread.sleep(2000);
  66.                 }
  67.                 catch (Exception e)
  68.                 {
  69.                 }
  70.                                
  71.                 AlertType.WARNING.playSound(Display.getDisplay(this)); 
  72.    
  73.                 try
  74.                 {          
  75.                     platformRequest("http://translate.google.com/translate_tts?q=" + textBeat.getString());
  76.                 }
  77.                 catch (Exception ex)
  78.                 {
  79.                     formData.append("Celular nao compativel");
  80.                     formData.append("www.ips-team.blogspot.com");
  81.                     formData.append("www.celularnokiac3.blogspot.com");
  82.                 }
  83.             }
  84.         }
  85.     }
  86.  
  87.     public void pauseApp()  {
  88.     }
  89.  
  90.     public void destroyApp(boolean unconditional) {
  91.     }
  92.  
  93. }
Add Comment
Please, Sign In to add comment