Ok, I changed to
Wait For and understand it. At the end the sub continues without stopping the smartphone.
Because the Filesize is 33MByte and the transfer needs some time to be finished, I would now like to try a new way.
Is there a possibility to get informed about the number of the transfered byte?
I would like to use async loading files from internet and from filesystem.
But I'm a beginner and all these tutorials use a lot of new stuff and additional libraries. Often the tutorials are out-of-date and link to a link to a.... Too many "wrong" informations for a beginner, who only wants to code a small learning app to understand.
So now I start a new threat after searching for a hour. please help me with an easy to understand solution
What is the most basic way to load a file async?
I would like to use the first 10000 Byte already, when the transfer is still running. Is there a way?
I would like to know how many bytes are already transfered for a progress bar.
I think i got a first success with in-streaming a file from the filesystem:
Sub Globals
Private Button1 As Button
Private Zeit As Long
Private Summe As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main.bal")
End Sub
Sub Button1_Click
Zeit=DateTime.Now
NeuesLaden("Oma.jpg")
End Sub
Sub NeuesLaden(FileNamen As String)
Dim locStream As AsyncStreams
locStream.Initialize(File.OpenInput(File.DirInternal,FileNamen),Null,"Laden")
End Sub
Sub Laden_NewData(Buffer() As Byte)
Summe=Summe + Buffer.Length
Log("new data coming" & (DateTime.Now-Zeit ) & " Lang=" & Summe)
End Sub
Sub Laden_Terminated
Log("Ende des Streams" & (DateTime.Now-Zeit ))
End Sub
Now I try to do the same with files coming from the internet...