I can't use DefaultHttpClient because I need to get the OutputStream for writing to the remote server. But anyway... I accidently got this working, by calling the method that starts the thread (where all HttpUrlConnection stuff is handled) from an Activity class. Before I had it in a class that implements the onClickListener interface. But I have no idea why it is working now correctly.
-Mika On Apr 23, 9:39 pm, Streets Of Boston <flyingdutc...@gmail.com> wrote: > I had a similar issue and i gave up. > Instead i used the DefaultHttpClient class together with HttpPut/ > HttpGet/HttpResponse classes. > > This works fine. > > On Apr 23, 5:50 am, Mika <mika.ristim...@tkk.fi> wrote: > > > Hi all, > > > I have a strange problem with HttpUrlConnection. I can send data (with > > POST), but the receiving succeeds only every second time or after a > > sufficiently long (< 5 min) pause between the sends. I basically start > > a new thread where the initialization of the HttpUrlConnection, > > writing/reading from output/input streams and closing the connection > > is done. If I don't close the input and the output streams the sending > > works correctly each time. > > > Any suggestions where's the problem? The same problem was discussed in > > herehttp://groups.google.com/group/android-developers/browse_thread/threa... > > but no solution were found. > > > -Mika --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---