View Single Post
Old 06-06-2008, 06:02 PM   #10
mateo666
New Member
 
Join Date: May 2008
Model: 8830
PIN: N/A
Carrier: bell
Posts: 11
Default

Hi i'm doing this with post and it is working fine. i'm just sending some headers though. Glad to share what i have with you.

try {
_conn = (HttpConnection) Connector.open(_url);
_conn.setRequestMethod(HttpConnection.POST);
_conn.setRequestProperty("Content-Type", "text/plain; charset=utf-8");
_conn.setRequestProperty("Expect", "100-continue");
_conn.setRequestProperty("GpsCoordinate", Double.toString(sendingPoint.getQualifiedCoordinat es().getLatitude()) + "," + Double.toString(sendingPoint.getQualifiedCoordinat es().getLongitude()));
_conn.setRequestProperty("GpsUser", Integer.toHexString(DeviceInfo.getDeviceId()));

responseCode = _conn.getResponseCode();
if (responseCode != HttpConnection.HTTP_OK) {
throw new IOException("Not able to send.");
}
sendingPoint=null;
} catch (IOException e) {
} finally {
try {
if(_out!=null)
_out.close();
if(_conn!=null)
_conn.close();
} catch (IOException ioe) {
//no-op - we don't care on close
}
}

If you know a good javascript code to get the coordinates in a web form i would be glad to have a look on it as i'm trying to force a refresh of the coordinates in the browser and its not working:(

Hope this helps
mateo
Offline   Reply With Quote