Re: [android-developers] what's wrong with this http post to server code?

2011-06-27 Thread lily
Have you add the internet permission in manifest like this? uses-permission android:name=android.permission.INTERNET/uses-permission ? 2011/6/27 11:10, ??? ??: I use deflater to compress string data. It works fine on java console project, but while running on android enviroment, server will

Re: [android-developers] what's wrong with this http post to server code?

2011-06-27 Thread 陈彧堃
i found the problem by myself. It's problem of the usage of deflater, correct solution should be: public static byte[] deflaterCompress(String str) throws IOException { TOTAL_LEN = 0; byte[] input = str.getBytes(encoding); Deflater deflater = new Deflater(); deflater.setInput(input);

[android-developers] what's wrong with this http post to server code?

2011-06-26 Thread 陈彧堃
I use deflater to compress string data. It works fine on java console project, but while running on android enviroment, server will report buffer error problem and reture 500. SendMessage(String content, String url) { byte[] bs = deflaterCompress(content); URL url = new URL(urlStr);

Re: [android-developers] what's wrong with this http post to server code?

2011-06-26 Thread из за Угла
You do not set content length. It supposes to be chunked, but it's worth to set some http watcher and see what actually you transfer. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to

Re: [android-developers] what's wrong with this http post to server code?

2011-06-26 Thread 陈彧堃
i tried that, result has no difference 2011/6/27 Дениска, Рынский (из за Угла) denis.ryn...@gmail.com You do not set content length. It supposes to be chunked, but it's worth to set some http watcher and see what actually you transfer. -- You received this message because you are subscribed