1

Hi am trying to post video file on Facebook from my android application, I am able to post 5MB file successfully but when I am trying to post large file say 95MB java.lang.OutOfMemoryError brokes out. I followed this link to post the video.

Is there any other methods to post the video file on Facebook. Please help me to resolved this issue.

Thank you.

Community
  • 1
  • 1
vinay kumar
  • 1,451
  • 13
  • 33
  • Yes it is possible. but it will take time based on your video file size. Please refer this answer to post video file. http://stackoverflow.com/questions/10151708/upload-video-to-facebook-in-android/12470730#12470730 – Shreyash Mahajan Dec 28 '12 at 05:39

1 Answers1

1

Your video filesize is probably larger than the amount of free memory allocated on your device. Considering that you said you were trying to upload a 95MB file on your smartphone, that is too large to hold in a byte[].

I found solutions online that allows you to upload chunks of data at a time to prevent OOM exceptions, but AFAIK our Facebook Android SDK doesn't have that sort of option available. Your best bet is to either compress/scale the video to a more acceptable size, or write your own method to POST a video to Facebook in chunks.

Community
  • 1
  • 1
Jesse Chen
  • 4,928
  • 1
  • 20
  • 20