| Reply | « Previous Thread | Next Thread » |
|
I have two 7650, and in one it was working httpconnection but after 2 days using, is not working anymore. Then I downloaded the same applet to another phone and it's working. Probably will stop in next 2 days....
WHAT's the problem with 7650 ???? It block on openInputStream... Regards, Bruno |
|
this works for me! works really good actually.
public byte[] postViaHttpConnection7650(String url, String extUrlRequest) throws IOException { StreamConnection c = null; InputStream s = null; OutputStream o = null; StringBuffer b = new StringBuffer(); byte[] tmp; try { c = (StreamConnection)Connector.open("socket"+url); o = c.openOutputStream(); String str = "POST / HTTP/1.1\r\n\r\n" + extUrlRequest; o.write(str.getBytes()); o.flush(); s = c.openInputStream(); byte[] data; int i = 0; byte ch; data = new byte[2200]; ch = ((byte) s.read()); while(ch != 37 && ch != 64) // 37 = '%', 64 = '@' { ch = ((byte) s.read()); data[0] = ch; } while(ch != -1 && ch != 38) { ch = ((byte) s.read()); i++; data[i] = ch; } if (ch == 38) { data[i++] = ch; } tmp=data; } finally { if(s != null) { s.close(); } if(c != null) { c.close(); } if( o != null){ o.close(); } } return tmp; } note that some of code may be left out. /Bjarne Johannessen |
|
yes! if the url has the format "://www.abc.com" =) the reason I use this is that the 6310 connects the "usual" way in the 6310-function i do "http"+url instead. got it?
so use "socket://123.123.123.123:80" for example. /Bjarne |
|
I propose this:
what about all together, for instance 10$ for each, collect the 200$ necessary to use the service "Technical Case Solving" of nokia ? We pay 10$ each of use, but finally Nokia will send us a really working MIDLET which connect to any http server, using post, and writes on the screen of the phone the output. |
|
Nice idea, but why should we long suffering developers pay Nokia to fix problems with their implementations of j2me? Personally I would like Nokia to pay me back some $ for the time I spent on making http POST/GET work on the N7650 :)... I am now wondering whether I am facing the same thing with the very weird Nokia UI API.
Steve O'Connor |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|