07-21-2008 01:46 PM
Thanks indeed for your patient answers
For me, it seems TCP method will work. I will try to implement this into my program and let you know, how it works.
As MDS method needs BES installed, i think it's not good to punish our users to install that.
And thanks again SIR!!!
07-23-2008
12:04 PM
- last edited on
07-23-2008
01:04 PM
by
MSohm
Hi,
I did enterprise activation on my 8100 and tried the following
try {
byte[] data = message.getBytes();
int dataLength = data.length;
HttpConnection httpConnection = (HttpConnection) Connector.open("https://secure.sample.com/hello.ph
httpConnection.setRequestMethod(HttpConnection.POS
String itemData=""; int d;
InputStreamReader stream=new InputStreamReader(httpConnection.openInputStream()
int returnCode=httpConnection.getResponseCode();
if(returnCode==HttpConnection.HTTP_OK){
while (true){
d=stream.read();
if (d==-1) break;
else itemData+=((char) d);
}
}
}
catch (Throwable ex) {
ex.printStackTrace();
screen.updateScreen(ex.toString());
}
finally {
httpConnection = null;
httpInput = null;
httpOutput = null;
}
When execution is in the line
int returnCode=httpConnection.getResponseCode();
an error pop-up says,
An Uncaught exception: Applcation connectionSample is not responding. Process terminated.
I think connection has been created. But not getting the response.
Please advice me on this.
I thank you.
07-23-2008 01:07 PM
Are you creating the connection in its own thread? This can happen if you try t open a connection on the main event thread.
Support - Application stops responding when opening a connection
Article Number: DB-00159
07-23-2008 02:17 PM
07-24-2008 03:48 PM
Nope, i have
I called the statement
pushScreen(new ConnectionExampleScreen());
in constructor of ConnectionExample
On the button event of ConnectionExampleScreen, i called
Thread postnameThread = new Thread(new ServerConnection(nameField.getText(), screen));
ServerConnection has the follwing in run()
httpConnection = (HttpConnection) Connector.open(url);screen.updateScreen("Connector
Please let me know, if i am using the thread properly.
I will be here, if you need anything from me.
Thanks!!!
07-25-2008 10:14 AM
08-11-2008 08:55 PM