Android Question 1° progresbar

Douglas Farias

Expert
Licensed User
Longtime User
hello. wanted to ask help from you with a progresbar
is the first time I'm trying to create an unable
and did not find many examples of exactly this
I'm sending an image to the server and wanted to create a progresbar upload to see how many kb are being sent

from 0 to 100%

someone help me with this first example?

Below is my code for sending the image to the server

THANK YOU!

B4X:
    Sub cc_Result (Success As Boolean, Dir As String, FileName As String  )
    If Success Then
    ProgressDialogShow2("Enviando foto, aguarde...", False)
    'Dim bmp As Bitmap
    'Dim testee As String
  ' bmp.Initialize(Dir, FileName)
    File.Copy(Dir, FileName,FP, "1.jpg")
    Dir = FP
    'Activity.SetBackgroundImage(bmp)
      
    'Dim imagemenviar As Bitmap
  
    'imagemenviar.Initialize(Dir, FileNames)
    enviaimagem.Initialize("enviaimagem")
    'Msgbox(testee,"teste")
    Dim files As List
    files.Initialize
      Dim fd As FileData
      fd.Initialize
        fd.Directory = FP
        fd.FileName = "1.jpg"
    fd.KeyName = "RWQ0kbmG"
    fd.ContentType = "application/octet-stream"
    files.Add(fd)
    
      Dim NV As Map
        NV.Initialize
        NV.Put("UserID", userid)
        NV.Put("action", "upload")
      Dim reqs As HttpRequest
      reqs = poste.CreatePostRequest("http://74.63.153.75/recebeimagem.php", NV, files)
      enviaimagem.Execute(reqs, 2)


    Else
    ToastMessageShow("Imagem não selecionada", True)
    End If
    End Sub
 
Top