Android Question Problem downloading web files.

ELCHARO

Member
Licensed User
Longtime User
My app, use httpjob to download a file.

I compile in this platforms
android-17
android-23
android-25

Now i use OkHttp 1.01 lib
Source code of
HttpJob & HttpUtils2Service + line change to
B4X:
hc.InitializeAcceptAll("hc")

Work in S7edge and S5, but not in others smartphones (olders) or ANDY & BLUESTACKS emulators.

Q1: Are a solution? or Are a minimal O.S. version to use this library?

Really don't found a solution in the community, changing the code or the library not only don't resolve the problems, sometime i never finish the compilation. And web reference send me to JAVA level (a close way for me)

Understand in which line fail, the log tell me. But not why?

Thanks.





Error: In phone "javax.net.ssl.SSLExeption: Connection close by peer.
In B4A log
---------------------------------------------------------------------------------
** Service (httpservice) Create **
** Service (httpservice) Start **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
JobName = Job4a, Success = false
Error: javax.net.ssl.SSLException: Connection closed by peer
JobName = Job3a, Success = false
Error: javax.net.ssl.SSLException: Connection closed by peer
--------------------------------------------------------------------------------------

B4X:
Sub Service_Start (StartingIntent As Intent)
   Dim job3a,job4a As HttpJob

 
   semaforo = 0
    ToastMessageShow("WEB_SAT1-Espere",True)
   job3a.Initialize("Job3a", Me)
'   job3a.Download("https://firms.modaps.eosdis.nasa.gov/active_fire/c6/text/MODIS_C6_Global_24h.csv")
   job3a.Download("https://firms.modaps.eosdis.nasa.gov/active_fire/c6/text/MODIS_C6_South_America_24h.csv")

    ToastMessageShow("WEB_SAT2-Espere",True)
    job4a.Initialize("Job4a", Me)
''   job3a.Download("https://firms.modaps.eosdis.nasa.gov/active_fire/viirs/text/VNP14IMGTDL_NRT_Global_24h.csv")
   job4a.Download("https://firms.modaps.eosdis.nasa.gov/active_fire/viirs/text/VNP14IMGTDL_NRT_South_America_24h.csv")
End Sub

Sub JobDone (Job As HttpJob)
   Log("JobName = " & Job.JobName & ", Success = " & Job.Success)

   If Job.Success = True Then
       '    Log(Job.GetString)
        If Job.JobName = "Job3a" Then
            File.WriteString(File.DirDefaultExternal,"listado.csv",Job.GetString)
            ToastMessageShow("READ_SAT1", True)
            semaforo =semaforo+1
        Else
            File.WriteString(File.DirDefaultExternal,"listado2.csv",Job.GetString)
            ToastMessageShow("READ_SAT2", True)
            semaforo =semaforo+1
        End If
  
   Else
      Log("Error: " & Job.ErrorMessage)
      ToastMessageShow("Error: " & Job.ErrorMessage, True)
   End If
   Job.Release

    If semaforo = 2 Then
        semaforo=0
'        ToastMessageShow("Redraw Dibujando.....", True)
        Main.Logueado=True

    '    CallSub(Main, "Dibuja")
      
        'Activity.Finish
    End If
End Sub


PD: The problematic APP.
https://play.google.com/store/apps/details?id=mapadeincendios.com.ar

If a alpha version. Give error the first time ( no files).
First menu option (Actualizar)
If not make the error you can see in my country (ARGENTINA) the NASA fire logs.
I want to open to the world data, but must be more stable.

Thanks again.
 
Top