I've developed a frontend java midlet to collect data and send it to an already established backend. The backend takes its input via the URL eg www.backend.org/input.do?var1=x+var2=y
Is this possible to do? Do I still have to use bitstreams if I am simple calling or "opening" a URL?
I've tried many ways with variable rates of success. Like using http with bitstreams sent the data but then the midlet froze. This is probably a silly and simple query but please can someone help a novice J2ME programmer.
Here is my communication to the backend (the simple non bitstream https method)
public void run()
{
String urlT1 = "https://www.backend.org/input.do";
String urlInfo = _patient.getPatientInfo(); // input variables
String url = urlT1 + "" + urlInfo;
try {
// Query the server and retrieve the response.
HttpsConnection hc = (HttpsConnection) Connector.open(url);
hc.close();
} catch (IOException ioe) {
Alert a = new Alert("Exception", ioe.toString(), null, null);
a.setTimeout(Alert.FOREVER);
_controller.newAlert(a);
}
}

Reply With Quote

