I have developed one simple application in J2ME. Application just do simple HttpConnection and make only request. Here is the code for that :
public void run() {
System.out.println("Inside saveData");
HttpConnection hc = null;
OutputStream dout = null;
try {
System.out.println("custName = " + custName);
System.out.println("prodName = " + prodName);
System.out.println("qty = " + qty);
hc = (HttpConnection) Connector.open("http://www.sufalamtech.com/demo/mobile/test.php?custName=" + custName + "&prodName=" + prodName + "&qty=" + qty);
//hc = (HttpConnection) Connector.open("http://www.sufalamtech.com/demo/mobile/test.php?custName=Custtt51&prodName=Proddd52&qty=53");
//hc = (HttpConnection) Connector.open("http://www.sufalamtech.com/demo/mobile/test.php?custName="+custName+"&prodName="+prodName+"&qty="+qty);
hc.setRequestProperty("User-Agent", "Profile/MIDP-2.1 Configuration/CLDC-1.1");
hc.setRequestMethod(HttpConnection.GET);
dout = hc.openOutputStream();
} catch (Exception e) {
System.out.println("Error... = " + e);
} finally {
try {
if (dout != null) {
dout.close();
}
if (hc != null) {
hc.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
This works fine in PC (simulator). But when i am deploying .jar file on my Nokia 5310, it is not returning anything from HttpConnection.
Actually i don't want to receive any data from URL. I just wanna send request to my URL. Else will be done by that URL only... My Application is works fine in Nokia 3110 Classic. But not working on Nokia 5310. Do you have any suggestion plz ?
Thanks...