Reputation: 2593
I have made a method to make http request using LWUIT IO library and also tried with J2me library. Everything is working fine on simulator but when i tired on two different Nokia phones then i have received exception. Both are showing different exceptions. Exceptions-
Here is my code-
private void startReq(String url) {
NetworkManager.getInstance().start();
ConnectionRequest myRequest = new ConnectionRequest() {
protected void readResponse(InputStream input) throws IOException {
StringBuffer stringBuffer = new StringBuffer();
int ch;
while ((ch = input.read()) != -1) {
stringBuffer.append((char) ch);
}
System.out.println("Response:"+stringBuffer.toString());
}
};
progress = new Progress("Please Wait ", myRequest,true);
progress.setDisposeOnCompletion(true);
myRequest.setUrl(url);
myRequest.setPost(true);
NetworkManager.getInstance().addToQueue(myRequest);
progress.show();
}
Upvotes: 1
Views: 97
Reputation: 2593
I have found the solution , it was problem related to Mobile Access Point. I could not recognize the problem because internet was working in browser very fine. so i could not guess that the reason can be Access Point. The problem was solved but still i am not satisfied and also surprised that how all applications were able to access internet service instead my Midlet.
Check this link to change access point settings
and if somebody knows the reason of this behavior kindly clear my doubt.
Upvotes: 1