Downloading Files from Internet using DownloadManager Class - Android Tutorial (Coding)


Author: Wingnity
24583 View
29m 45s Lenght
156 Rating


Join complete course at: http://www.wingnity.com/android ----------------- In this tutorial we will learn how to download files in your application. We will also learn how to use DownloadManager that is a system service that handles long-running HTTP downloads. --------------------------------- Please share and ask questions.


Comments

  1. Thank you for making this video.
    Question, I would like to make a library kind of app where I can download predetermined files from online to be read on the mobile device app. Would the method shown in this tutorial be a good route for doing that?
    Thanks again.
  2. hello i have a android app in which there is few youtube videos in that , now i wanna give download option in that how shud i do that please help i m new in android...tell me the steps thanks in advance
  3. is it the same for using android studio?
  4. I want to play streaming .m3u8 files in a webpage link within android app. How can it be done?
  5. You should get a faster wifi cuz a 5mb would take me 2 seconds to download.
  6. Hi, I'm trying to implement this on an android tv emulator without success, is it any special consideration for this scenario? If I run on tablet or phone emulator it works fine.

    Hope you could help me.
  7. Hi Thanks for this nice video, but when i start download it will show "download unsuccessful" Please tell me how can i solve this priblem
  8. I am Nikhil from India.
    I am developing an Android app for downloading documents.
    I am facing a problem for the same.
    I need to store the documents on internet and from there using the app students can download the documents.
    The problem is where should I store the documents.
    Please help me with this.
    Thnks in advance.
  9. One thing I wanted to add is, I was facing issue with CreateNewFile(). This was because I wasn't getting the WRITE_EXTERNAL_STORAGE permission, even though I had added it to Manifest.XML. The solution is to ask for permission dynamically (for newer androids) using the following:


    ActivityCompat.requestPermissions(thisActivity,
    new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
    MainActivity.MY_PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE);

    There can be a callback to see if the user did grant permission or not.

    @Override
    public void onRequestPermissionsResult(int requestCode,
    String permissions[], int[] grantResults) {
    switch (requestCode) {
    case MainActivity.MY_PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE: {
    // If request is cancelled, the result arrays are empty.
    if (grantResults.length > 0
    && grantResults[0] == PackageManager.PERMISSION_GRANTED) {

    HAS_WRITE_PERMISSION = true;

    } else {

    HAS_WRITE_PERMISSION = false;
    }
    return;
    }
  10. Thanks bro! Are you from Bihar/Jharkhand? Great job!!
  11. thanks for the tutorial. very Help full.
  12. Download Manager, video download, can we ?
  13. +Wingnity What to do if the URL does not include the filename? how to download it then... pls help
  14. Hi, i get error on getActivity, it is red , any suggestion why ? Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
    intent.setData(Uri.fromFile(file));
    getActivity().sendBroadcast(intent); // this line is red
  15. Is the downloaded file getting downloaded in sd card ? Because i am getting this error as i dont have an SD card -> java.lang.SecurityException: No permission to write to /storage/emulated/0/Download/myFile: Neither user 10218 nor current process has android.permission.WRITE_EXTERNAL_STORAGE.
    Any help will be appreciated
  16. Can I Download every think.
  17. were i can download the source code?
  18. Thanks, this video helpful.
    now I have on problem, how can I make AsyncTask with 2 our more URL?
  19. Oh man thanks that's exactly what I was looking for.
  20. nice tutorial....