Thursday, August 18, 2011

[android-developers] Re: App Crash during HTTP Post

Hi Murphy,

I am using File Entity to get the file and subsequently do HTTP Post
as shown in the code snippet below.

HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(postURL);
FileEntity bin = new FileEntity(file, postURL);
post.setEntity(bin);
HttpResponse response = client.execute(post);

Not sure whether this way of doing the HTTP Post is causing a crash
when the file size is too big.

Thanks and Regards,
Perumal

On Aug 18, 6:22 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> On Thu, Aug 18, 2011 at 2:30 AM, perumal316 <perumal...@gmail.com> wrote:
> > I checked the logcat, it is showing:
>
> > ERROR/AndroidRuntime(10335): FATAL EXCEPTION: main
> > ERROR/AndroidRuntime(10335): java.lang.NullPointerException
>
> > But the issue is, this crash is only occurring when I do HTTP Post of
> > a large file (>10 MB).
>
> > Is it a Android limitation? Anyone encountered this before?
>
> It may be a side effect of running out of heap space, depending on how
> you implemented your HTTP operations.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, One Low Price!

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment