Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/04/2008, 15:30
Avatar de alanis1
alanis1
 
Fecha de Ingreso: marzo-2008
Mensajes: 44
Antigüedad: 16 años, 11 meses
Puntos: 1
Re: Programacion de mobiles en java2me

Bueno, ps yo no es q sea la redura en esto pero leyendo y probando se hacen las cosas, porq no buscas info de http conection?? mira tengo un ejemplo espero te ayude:

import java.io.IOException;
import java.io.InputStream;
import javax.microedition.io.Connector;
import javax.microedition.io.StreamConnection;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;


public class ValidaView1 extends MIDlet {
private TextBox txb = new TextBox("Contenido Web",null,500,TextField.ANY);
private Display display = Display.getDisplay(this);

private String LeerUrl() throws IOException {
StreamConnection c = null;
InputStream s = null;
String st = "";

try {
c = (StreamConnection)Connector.open("http://www.google.com");
s = c.openInputStream();
int ch;
while ((ch = s.read()) != -1) {
st += (char)ch;
}
} finally {
if (s != null)
s.close();
if (c != null)
c.close();
}

return st;
}

public void startApp() {

display.setCurrent(txb);

try
{
String s = this.LeerUrl();
txb.setString(s);
} catch (IOException ex)
{
ex.printStackTrace();
}

}

public void pauseApp() {
}

public void destroyApp(boolean u) {
}
}

Pruebalo, y avisas, cuidat chau

;)