You Are Here:

Community: Developer Discussion Boards

#1 Old RE: ALL TOGETHER to call "Technical Case Solving" for 7650 http - 1970-01-01, 02:00

Join Date: Mar 2003
Posts: 2
bgoyanna
Offline
Registered User
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
Reply With Quote

#2 Old RE: ALL TOGETHER to call "Technical Case Solving" for 7650 http - 1970-01-01, 02:00

Join Date: Mar 2003
Posts: 39
bjajo780
Offline
Registered User
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
Reply With Quote

#3 Old RE: ALL TOGETHER to call "Technical Case Solving" for 7650 http - 1970-01-01, 02:00

Join Date: Mar 2003
Posts: 39
bjajo780
Offline
Registered User
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
Reply With Quote

#4 Old ALL TOGETHER to call "Technical Case Solving" for 7650 http - 2002-11-22, 22:23

Join Date: Mar 2003
Posts: 10
alex70
Offline
Registered User
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.
Reply With Quote

#5 Old RE: ALL TOGETHER to call "Technical Case Solving" for 7650 http - 2002-12-11, 15:18

Join Date: Mar 2003
Posts: 7
s_oconnor
Offline
Registered User
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 With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia