Re: [android-developers] Re: App Crash during HTTP Post
On Fri, Aug 19, 2011 at 1:28 AM, perumal316 perumal...@gmail.com 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
[android-developers] Re: App Crash during HTTP Post
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 ERROR/AndroidRuntime(10335): java.lang.NullPointerException You need to look through the next series of lines for a Caused by and then a second series of at lines. Find the first one is part of your project and look at what you are doing on that line. Something on that line of code is unexpectedly null. Figure out why, and/or 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 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
[android-developers] Re: App Crash during HTTP Post
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 ERROR/AndroidRuntime(10335): java.lang.NullPointerException 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 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 cs07...@gmail.com 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 simonaplat...@googlemail.com 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 cs07...@gmail.com 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
[android-developers] Re: App Crash during HTTP Post
Hi Murphy, 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? Thanks In Advance, Perumal On Aug 17, 7:04 pm, Mark Murphy mmur...@commonsware.com wrote: On Wed, Aug 17, 2011 at 7:00 AM, perumal316 perumal...@gmail.com wrote: I noticed that during HTTP Post of files to a backend server if the connection is not established (no reception) or the file size is too big (10MB) my application crashes. Is there any way to solve this issue? How do I handle for such errors? Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine LogCat and look at the stack trace associated with your crash. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.0 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
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/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
[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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en