Ok, i made some modifications to your class, i found the following issues:
#1 You need to create the directory where the mp3 will be downloaded to, this was the reason why your example would fail in my LG-G3 running lollipop version.
I added the following code for that:
If File.IsDirectory(File.DirRootExternal, Folder) = False Then
Log("creating directory: " & Folder)
File.MakeDir(File.DirRootExternal, Folder)
Else
Log("Folder already exists!")
End If
#2 You need to register the DownloadManager, otherwise the DownloadComplete Sub will never be raised.
I added the following code for that
DownloadManager1.RegisterReceiver("DownloadManager1")
#3 You are using a Utils module, which was never initialized.
I added the following code for that
If Utils.IsInitialized=False Then
Utils.Initialize(DownloadManager1)
End If
#4 I noticed that when you are using a secured network, the requests don't work, and I also unencoded the URL retrieved.
using the following code:
Dim su As StringUtils
DOWNLOAD_ADDRESS =valore.link.Replace("http", "https")
DOWNLOAD_ADDRESS = su.DecodeUrl(DOWNLOAD_ADDRESS, "UTF-8")
#5 and lastly, I moved this code:
to the Private Sub DownloadManager1_DownloadComplete(DownloadId1 As Long) sub
you had it at the JobDone sub which was not realistic, as the true completion of the download is at the DownloadManager1_Downloadcomplete sub.
i'm attaching the revised version of your class, you should recompile with a new version and repost it.
Cheers,
Walter