I test this program in NOKIA 7650, i establish the connection with server(in server log) but i have a strings null reponse from server. in textbox i have a strings null ( grade=null). I don't know what's the problem.(this example work very fine in emulator).
did you test this program in 7650 and tel me if you have "Hello Name: Your final grade is: A" in textbox of midlet?????
i don't know what's the problem ,
can you help me.

thank you very match




----------------------------------------------------------------------
package nkntest;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class TestMIDlet extends MIDlet implements CommandListener
{
private Display display;
private HTTPConnection httpConnection;

private TextBox textBox;
private Command fetchCommand;
private Command exitCommand;

public TestMIDlet()
{
fetchCommand = new Command("Fetch", Command.SCREEN, 1);
exitCommand = new Command("Exit", Command.EXIT, 1);
textBox = new TextBox("Fetch Grade", "Choose Fetch command to load data", 200, 0);
textBox.addCommand(fetchCommand);
textBox.addCommand(exitCommand);
textBox.setCommandListener(this);
display = Display.getDisplay(this);
}

public void startApp()
{
display.getDisplay(this).setCurrent(textBox);
}

public void pauseApp()
{

}

public void destroyApp(boolean unconditional)
{

}

public void commandAction(Command c, Displayable d)
{
if (c == fetchCommand)
{
(new Thread(new HTTPConnection(this))).start();
}

if (c == exitCommand)
{
destroyApp(false);
notifyDestroyed();
}
}

public void requestResult(String grade)
{
textBox.setString(grade);
}
}

----------------------------------------------------------------------

----------------------------------------------------------------------
package nkntest;

import java.io.*;
import javax.microedition.io.*;

public class HTTPConnection implements Runnable
{
private TestMIDlet midlet;
private String grade;

public HTTPConnection(TestMIDlet midlet)
{
this.midlet = midlet;
}

public void doRequest()
{
String url = "http://www.javacourses.com/cgi-bin/getgrade.cgi?idnum=182016";
HttpConnection connection = null;
InputStream is = null;
StringBuffer b = new StringBuffer();

try
{
connection = (HttpConnection)Connector.open(url);
connection.setRequestMethod(HttpConnection.GET);
is = connection.openInputStream();

int ch;
while((ch = is.read()) != -1)
{
b.append((char) ch);
}
grade = b.toString();

}
catch(IOException e)
{
e.printStackTrace();
}
finally
{
try
{
if (is != null) is.close();
if (connection != null) connection.close();
}
catch(IOException e)
{
e.printStackTrace();
}

midlet.requestResult(grade);
}

}

public void run()
{
doRequest();
}
}
----------------------------------------------------------------------