04-15-2010 02:54 AM
I am using Blackberry Bold 9000 device. I am fetching xml using Http connection. On my simulator it is working fine.(Please note that i will have to keep MDS-CS running while HTTP request.)
but when i install application on device it only shows UI elements. No data is downloaded from HTTP connection.
Do i have to apply any settings on device? please suggest.
Solved! Go to Solution.
04-15-2010 04:48 AM
Make sure you set the connection string correctly.
There is a very good guide here: http://www.localytics.com/blog/post/how-to-reliabl
04-15-2010 04:52 AM
04-15-2010 05:12 AM - edited 04-15-2010 05:13 AM
Here is my code that i used to get response from remote server using Httpconnection:
HttpConnection httpConn = null;
StreamConnection s = null;
s = (StreamConnection)Connector.open("http://www.samplewebsite.com/response.xml");
httpConn = (HttpConnection)s;
len = (int)httpConn.getLength();
if (len >= 0)
InputStream inputStream = httpConn.openInputStream();
byte responseData = new byte;
int length = 0;
while (-1 != (length = inputStream.read(responseData)))
rawResponse.append(new String(responseData, 0, length));
System.out.println("WOW---Search Result ---->"+rawResponse.toString());
Please suggest if i need to modify in this code.
04-15-2010 05:19 AM
04-15-2010 08:34 AM - edited 04-15-2010 08:35 AM
The link you provide gave me details where i was missing the things. Actually for wifi use i forget to add "interface=wifi" flag while opening the connection.