Android Question How to save the image in the gallery after download

Thiago Alves de Farias

Member
Licensed User
Please, how to save the image in the gallery after download?

My code:

B4X:
Sub DownloadImagem(url As String)   
    Dim Job As HttpJob
    Job.Initialize("JobDownloadImg", Me)
        
    Job.Download(url)

    Wait For (Job) JobDone(Job As HttpJob)
    If Job.Success = True Then

        Dim out As OutputStream = File.OpenOutput(File.DirInternal, "teste.jpg", False)
        File.Copy2(Job.GetInputStream, out)
        out.Close
        Log("sucess")
    Else
        
        Log("Erro no Job: " & Job.ErrorMessage)
        pnlPainel.Visible=True
        ToastMessageShow("Erro ao baixar imagem!", True)
    End If
    
    Job.Release
    
End Sub
 

mangojack

Expert
Licensed User
Longtime User
Search Results for "save image to gallery" .... Top right hand corner.

 
Upvote 0
Top