Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Downloading a 3gp video file from Internet  RSS feed

 
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!

 
Rancher
Posts: 42975
76
  • 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.
 
When all four tires fall off your canoe, how many tiny ads does it take to build a doghouse?
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!