• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Downloading a 3gp video file from Internet

 
Monica Marcus
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to download a video file (extension 3gp) from a certain http address. My application starts downloading, but it stops after downloading 9216 bytes. The file length is 1734741. I tried to increase the heap by including the following line in the Manifest file:

android:largeHeap="true"

It does not help. Here is the fragment of the java code that deals with downloading:



The application uses a Progress Bar to show the progress of the download. Because the file length is quite big, I did logarithmic calculations. Also, I have several Log.v messages to see what's going on, I hope this does not hamper understanding of the code.
Anyway, my question refers only to the incomplete downloading of the 3gp file.

What can I do to download the video file? Thanks for the help I got so far with my previous questions!
It is a great forum!

 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How big is "quite big"?
 
Monica Marcus
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The file length is 1734741 bytes.
 
Monica Marcus
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I re-wrote the code so that it does only the downloading. Maybe this way one can give me an idea about what's wrong with it. I really need help. Can't get it to download the file



And strangely enough, sometimes the method connection.getContentLength() returns -1

 
Monica Marcus
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I found the opportunity to try the code on a real device and it works. The emulator is not that reliable... this is my conclusion.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic