How to download file from url in Android Studio.

Поділитися
Вставка
  • Опубліковано 9 бер 2021
  • Subscribe Channel :
    / @becodey
    Other Videos:
    1. how to log in and register using firebase in the android studio:
    • How to login and regis...
    2. Login and Register Using Sqlite in Android Studio :
    • Login and Register Usi...
    3. How to connect the android studio project to firebase :
    • How to connect android...
    4. How login and register using a phone number in the android studio:
    • Login and Register usi...
    5. how to create a navigation drawer in android studio.
    • Create a navigation dr...

КОМЕНТАРІ • 89

  • @manikuits
    @manikuits 2 роки тому +1

    Just wow bro...i am impressed

  • @EgorPlay2020
    @EgorPlay2020 2 роки тому

    Thank you very much, I have been looking for a very long time for an installation method and found it thanks to you.

  • @vinitgrover360
    @vinitgrover360 Рік тому

    For whoever needed -> if it's a pdf set mime type to be "application/pdf". Thanks for sharing the code

  • @DeviDot
    @DeviDot 2 роки тому

    How to add a link url to download a file inside the application android studio and from the admin panel

  • @maheshsangule1912
    @maheshsangule1912 11 місяців тому

    bro file is downloading but bin extension automatically assign to every file what to do

  • @gauthaml7216
    @gauthaml7216 2 роки тому

    Bro it is taking very long time to download and enqueue. Sometimes the download is missing as well.

  • @documentaryflims
    @documentaryflims 2 роки тому

    Thanks a lot , It's working for me

  • @abcdefj7144
    @abcdefj7144 3 роки тому

    How to download files from the Internet url using mediastore api

  • @himabindu2839
    @himabindu2839 2 роки тому

    I am not able to copy the link in enter url.

  • @sahanlahiru7193
    @sahanlahiru7193 7 місяців тому

    Thank you very much❤

  • @bryandche
    @bryandche Рік тому

    Thanks so much. Please how can I download a pdf file from firebase to app(offline view) 🙏

  • @be_apps2983
    @be_apps2983 2 роки тому +2

    how to max the speed of the download process

  • @vishakhamahajan2746
    @vishakhamahajan2746 Рік тому +1

    How can I download mp3 files from spotify by entering a spotify link? Please reply, urgent

  • @JirayuSutawong
    @JirayuSutawong 2 роки тому +1

    Can you suggest me in case big file size or internet loss but want continue to download

    • @BeCodey
      @BeCodey  2 роки тому

      Sorry you didn't download after losing internet connection

  • @balibramzi3806
    @balibramzi3806 2 роки тому +3

    Hello dear!
    How to show progress of downloading in downloads fragment. Can you make a tutorial please?

  • @kechkech389
    @kechkech389 Рік тому

    thank you so mach

  • @harthalhmati9564
    @harthalhmati9564 2 роки тому +1

    Excellent, very sweet, creative genius, please, can you code?

  • @pradeepseth7257
    @pradeepseth7257 3 роки тому +1

    i have an issue regarding to download url in adapter class will you help me to resolve this problem?

    • @BeCodey
      @BeCodey  3 роки тому

      Please share the code and tell me what exactly you want to do.

    • @pradeepseth7257
      @pradeepseth7257 3 роки тому +1

      @@BeCodey can you give me any medium where i can contact you

    • @BeCodey
      @BeCodey  3 роки тому

      Share In comment.

    • @abcdefj7144
      @abcdefj7144 3 роки тому

      @@BeCodey How to download files from the Internet url using mediastore api

    • @abcdefj7144
      @abcdefj7144 3 роки тому

      @@BeCodey How to download files from the Internet url using mediastore api

  • @vishalikuracha
    @vishalikuracha 3 роки тому +1

    can you tell me how to download a vedio from given url using async task

    • @BeCodey
      @BeCodey  3 роки тому +1

      You just have to put video download link into edittext

  • @ayansarkar2357
    @ayansarkar2357 3 роки тому +1

    Can you do a test in this app?
    Turn off your storage permission while file downloading. If your app crashes please tell me how to handle this condition.

    • @BeCodey
      @BeCodey  3 роки тому +1

      Sorry I can't , can you please try yourself

    • @shabir301
      @shabir301 3 роки тому

      Not use Environment.DIRECTORY_DOWNLOAD
      Use private app directory not required any storage permission

    • @user-rl6wc3bt7i
      @user-rl6wc3bt7i 3 роки тому

      download.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
      try {
      String geturl = url.getText().toString();
      DownloadManager.Request request = new DownloadManager.Request(Uri.parse((geturl)));
      String title = URLUtil.guessFileName(geturl, null, null);
      request.setTitle(title);
      request.setDescription("download file please wait.....");
      String cookie = CookieManager.getInstance().getCookie(geturl);
      request.addRequestHeader("cookie", cookie);
      request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
      request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, title);
      DownloadManager downloadManager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
      downloadManager.enqueue(request);
      Toast.makeText(MainActivity.this, "Downloading Starting ...", Toast.LENGTH_LONG).show();
      }catch (Exception e){
      Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();
      }
      }
      });

    • @user-rl6wc3bt7i
      @user-rl6wc3bt7i 3 роки тому +1

      copy this for handle error

  • @user-rl6wc3bt7i
    @user-rl6wc3bt7i 3 роки тому

    It does not work to download videos, I tried it and the result tells me that it has been downloaded and when opening it directs me to UA-cam and write encrypted and symbols
    What is the problem
    Or how is the correct way please?

    • @BeCodey
      @BeCodey  3 роки тому

      Put download link into search box

    • @BeCodey
      @BeCodey  3 роки тому +1

      I think you are putting any random url that's why it's downloads the html file of the webpage.

    • @MegaRockandroll09
      @MegaRockandroll09 2 роки тому

      You need to decode Stream of the video and then only can catch the bytes and make it into a video

    • @username_taken_se_pareshan_boi
      @username_taken_se_pareshan_boi Рік тому

      you can download any file with its downloadable link... like for youtube if you just put the link of the videe, it will not be downloaded....

  • @ajay.pradhan2k1
    @ajay.pradhan2k1 2 роки тому +1

    Can we download UA-cam too?
    By giving the url

  • @user-li6tx4ki5j
    @user-li6tx4ki5j Рік тому

    Can you please share the source code?

  • @preenxus3425
    @preenxus3425 3 роки тому +1

    thanks for java!

  • @braindroid9657
    @braindroid9657 3 роки тому +1

    i am unable to download a .db file with this method.... any idea ???

    • @BeCodey
      @BeCodey  3 роки тому

      Yes, you should to put download link of the file but I think your are using webpage download link

    • @braindroid9657
      @braindroid9657 3 роки тому

      @@BeCodey i put the link but it didn't work

  • @abhishekchaudhary4058
    @abhishekchaudhary4058 2 роки тому +3

    Bro the files are getting downloaded in .bin format and after renaming also, it doesn't work.

    • @kunwardeepsinghgujral1734
      @kunwardeepsinghgujral1734 2 роки тому +3

      You need to add format with title for example to download a picture just write request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DCIM,""+System.currentTimeMillis()+".jpg");
      Here instead of jpg, enter the format that you want.

    • @toonworldVlogsno1
      @toonworldVlogsno1 2 роки тому +1

      Bhai video ke liye .mp4 likhunga to chalega

    • @sajithmadusanka2028
      @sajithmadusanka2028 Рік тому

      @@kunwardeepsinghgujral1734 always only bin format when download mp4

  • @raghavaggarwal8644
    @raghavaggarwal8644 3 роки тому +1

    Dude, the file is not getting stored in the internal storage of phone currently it's getting stored in the app-specific storage inside Android folder. U know how to overcome this?

    • @BeCodey
      @BeCodey  3 роки тому +1

      If you followed all steps given in video then it is store in downloads folder in internal storage.

    • @raghavaggarwal8644
      @raghavaggarwal8644 3 роки тому +1

      @@BeCodey no dude i replicated ur code exactly, the file gets stored in the app specific storage

    • @BeCodey
      @BeCodey  3 роки тому

      Can you please share the code ?

    • @raghavaggarwal8644
      @raghavaggarwal8644 3 роки тому

      @@BeCodey yeah

    • @raghavaggarwal8644
      @raghavaggarwal8644 3 роки тому

      @@BeCodey DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
      String title = URLUtil.guessFileName(url,null,null);
      request.setTitle(title);
      request.setDescription("DOwnloading");
      String cookie = CookieManager.getInstance().getCookie(url);
      request.addRequestHeader("cookie",cookie);
      request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
      request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,title);
      DownloadManager downloadManager = (DownloadManager)getSystemService(DOWNLOAD_SERVICE);
      downloadManager.enqueue(request);
      Toast.makeText(MainActivity.this, "started", Toast.LENGTH_SHORT).show();

  • @malikhammad2582
    @malikhammad2582 3 роки тому +1

    Bro how to download file from specific URL and specific path

  • @CloudCODETech
    @CloudCODETech 6 місяців тому

  • @kingmanraj6682
    @kingmanraj6682 3 роки тому +1

    Is it working in android 10 and android11 ​​or not?

    • @BeCodey
      @BeCodey  3 роки тому +1

      Yes it is working on both Android 10 and Android 11

    • @kingmanraj6682
      @kingmanraj6682 3 роки тому +3

      Thanks 😊😊.
      Please make a tutorial on download a file in a custom created folder.

    • @BeCodey
      @BeCodey  3 роки тому +2

      Give me fews days I will create it for you.

  • @wizardop4260
    @wizardop4260 3 роки тому +1

    Can i download images and videos throw this link? Plz reply fast 🙏🙏

    • @BeCodey
      @BeCodey  3 роки тому

      Yes you can

    • @wizardop4260
      @wizardop4260 3 роки тому +1

      @@BeCodey i mean UA-cam videos and Instagram post!??🙏🙏🙏plz reply 🙏🙏🙏

    • @BeCodey
      @BeCodey  3 роки тому

      Yes you can but it needs lot of research

    • @wizardop4260
      @wizardop4260 3 роки тому

      @@BeCodey what mean of file i can download throw this link!!🙏🙏🙏

    • @BeCodey
      @BeCodey  3 роки тому

      You need download link of video, audio or any other media and put that into download manager

  • @RR-kf9er
    @RR-kf9er 3 роки тому +1

    Can it download torrent magnet link?

    • @BeCodey
      @BeCodey  3 роки тому

      No

    • @RR-kf9er
      @RR-kf9er 2 роки тому

      @@BeCodeydo you now that how to make torrent magnet downloader app in android studio

  • @ibrahimsafarini3024
    @ibrahimsafarini3024 Рік тому

    Can we download a magnet link with this method?

  • @qphixservicerepair6803
    @qphixservicerepair6803 3 роки тому +1

    File is downloading but is encrypted

  • @riteshsahu2102
    @riteshsahu2102 3 роки тому +1

    Brother this is not downloading 🙄🙄

    • @BeCodey
      @BeCodey  3 роки тому

      What's the problem?