Hi i am trying to connect to a http server using the new nokia n95 phone with T-mobile web and walk(Unlimited 3g internet access)
on the emulaor and on the phones wifi connection, it works. But when i try connecting to the server using gprs/3g it doesnt. The response code never equals to OK . here is my code below:
I know it is not working because has soon as the program makes an attempted to connect, the root.notifyDestroy() closes the application as i expect it too
Code:server = (HttpConnection) Connector.open(url); server.setRequestMethod(HttpConnection.POST); int rc = server.getResponseCode(); if (rc == HttpConnection.HTTP_OK) { is = server.openInputStream(); } else { root.notifyDestroyed(); Alert alert = new Alert ("Error"); alert.setString("Error, server is down"); alert.setTimeout (5000); Display.getDisplay(root).setCurrent(alert); throw new IOException("HTTP response code: " + rc); }


Reply With Quote


Bookmarks