code: public static boolean downloadToSDCard(String downloadURL, String sdcardPath) {
          try {
              URL url = new URL(downloadURL);
  
              URLConnection connection = url.openConnection();
              connection.connect();
  
              // download the file
              InputStream input = new BufferedInputStream(url.openStream());
              OutputStream output = new FileOutputStream(sdcardPath);
  
              byte data[] = new byte[1024];
              long total = 0;
              int count;
              while ((count = input.read(data)) != -1) {
                  total += count;
                  output.write(data, 0, count);
              }
  
              output.flush();
              output.close();
              input.close();
          } catch (Exception e) {
              e.printStackTrace();
              return false;
          }
  
          return true;
      }
docs: Download a file to the sdcard<br/>
  Please remember to <br/>
  <li>give your application the permission to access the Internet and to
  write to external storage</li> <li>Create the Folder (eg.
  <code>File wallpaperDirectory = new File("/sdcard/Wallpaper/");
  // have the object build the directory structure, if needed.
  wallpaperDirectory.mkdirs();</code>
  
  @param downloadURL from where you want to download
  @param sdcardPath  path to download the asset
  @return