Search code examples
basic4android

Downloading some files


I want to download a file and save it into my app folder. I have to download different files with different formats, but only one each time.

I've read that I have to use HttpUtils, but sample codes are to difficult for me (I'm too noob).

Can anyone upload any sample code?? Thanks!!


Solution

  • This is how I finally do:

    imgurl = "http://dl.dropbox.com/u/25045/file.jpg"
    HttpUtils.CallbackActivity = "myactivity" 'Current activity name.
    HttpUtils.CallbackJobDoneSub = "JobDone"
    HttpUtils.Download("Job1", imgurl)
    
    
     Dim out As OutputStream
     out = File.OpenOutput(File.DirInternal, "file.jpg", True)
     File.Copy2(HttpUtils.GetInputStream(imgurl), out)
     out.Close