Showing posts with label Blackberry. Show all posts
Showing posts with label Blackberry. Show all posts

Monday, March 21, 2011

internet connection with blackberry code

Internet Connection With Blackberry Java

String url= "http://www.test.com/test.jsp"

HttpConnection hc = (HttpConnection) Connector.open(url);
hc.setRequestMethod(HttpConnection.GET);
InputStream inputStream = hc.openInputStream();


if (DeviceInfo.isSimulator()) {
url = url + ";deviceSide=true";
}

String result = "";
for (int ch = inputStream.read(); ch != -1; ch = inputStream.read()) {
result = result + (char) ch;
}