Re: [android-developers] Re: App Crash during HTTP Post
On Thu, Aug 18, 2011 at 2:30 AM, perumal316 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/commonsguy http://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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: App Crash during HTTP Post
On Fri, Aug 19, 2011 at 1:28 AM, perumal316 wrote: > 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. That would be a question for the people who wrote HttpClient. Or, you can examine the source code for HttpClient (and stuff like FileEntity) yourself. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 3.9 Available! -- 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
Re: [android-developers] Re: App Crash during HTTP Post
10mb? Have you tried zipping it before posting? Depending on the content you could reduce the data size dramatically Regards,Sy On 19 Aug 2011 21:03, "Chris Stratton" wrote: On Thursday, August 18, 2011 2:30:43 AM UTC-4, perumal316 wrote: > > I checked the logcat, it is showing: > > ERROR/AndroidRuntime(10335): FATAL EXCEPTION: main >... You need to look through the next series of lines for a "Caused by" after which there will be a second series of "at" lines. Find the first one that refers to a file that is part of your project and look at what you are doing on that line number in the file. Something on that line of source code is something that is unexpectedly null. Figure out why it is null, and/or add a check to see if it is null, and if so handle that intelligently. -- You received this message because you are subscribed to the Google Groups "Android Develope... -- 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
Re: [android-developers] Re: App Crash during HTTP Post
Post the full logcat trace. Make sure you're not doing any network operations in the UI thread. Google 'java multi-part upload' for tips on how to chunk the upload. On Fri, Aug 19, 2011 at 2:26 PM, Simon Platten wrote: > 10mb? Have you tried zipping it before posting? Depending on the content > you could reduce the data size dramatically > > Regards,Sy > > On 19 Aug 2011 21:03, "Chris Stratton" wrote: > > On Thursday, August 18, 2011 2:30:43 AM UTC-4, perumal316 wrote: > >> >> I checked the logcat, it is showing: >> >> ERROR/AndroidRuntime(10335): FATAL EXCEPTION: main >>... > > You need to look through the next series of lines for a "Caused by" after > which there will be a second series of "at" lines. Find the first one that > refers to a file that is part of your project and look at what you are doing > on that line number in the file. Something on that line of source code is > something that is unexpectedly null. Figure out why it is null, and/or add > a check to see if it is null, and if so handle that intelligently. > > > > -- > You received this message because you are subscribed to the Google > Groups "Android Develope... > > -- > 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 -- ~ Jeremiah:9:23-24 Android 2D MMORPG: http://solrpg.com/, http://www.youtube.com/user/revoltingx -- 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