An app of mine that downloads a file from a site, works fine on my smartphone, (Huawei P20) while giving error on a friend's (Note 10)
The instruction that fails on his smartphone is this
B4X:
Dim j As HttpJob
Dim Sito As String = "https://www.miosito.it/MiaDir"
Dim SitoFile As String
j.Initialize("", Me)
SitoFile = File.Combine(Sito, "miofile.txt")
j.Download(SitoFile) ' <============= error
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim out As OutputStream = File.OpenOutput(DirDestination, "miofile.txt", False)
File.Copy2(j.GetInputStream, out)
out.Close '<------ very important
Result1=1
End If
and this is the log
ResponseError. Reason: java.net.UnknownHostException: Unable to resolve host "www.miosito.it": No address associated with hostname, Response:
What could it be, considering that everything works on another smartphone?
The site name was an example, not the real one!
From the browser can access (displays it in the browser) is a text file.
However now, without doing anything, it's working. Bah!
the real is www.bonificadestrasele.it/TurniTel/OTTOBR20.TEL