Android Question okhttp consultations

mvera

Active Member
Licensed User
Longtime User
Hi I have an app developed in httputils2
I need to pass it to okhttp
but I have problems

the code that regularly occupy httputils2 is:
B4X:
Sub Globals

    Dim envio_registro As HttpJob
 
End Sub




Sub Activity_Create(FirstTime As Boolean) 
 
    Activity.LoadLayout("registro")
    envio_registro.Initialize("carga",Me)  

End Sub






Sub bvalidar_Click
 
 
 
        miniruta=""&acciones.ruta_s&"validar_usuario.php"
        envio_registro.PostString(miniruta, "")
       
     
 
End Sub








'JOBDONE
Sub JobDone(Job As HttpJob)




    Dim m As Map
    Dim respuesta,query As String
 
 
    m.Initialize()
 
    Log("entramos....."&Job.Success)
 
 
 
    If Job.Success Then
    Dim res As String
        res = Job.GetString
     
        Log("Response from server: " & res)
        Dim parser As JSONParser
     
     
        parser.Initialize(res)
     
        Log("NOMBRE....."&Job.JobName)
         
        Select Job.JobName
     
         
                 
                 
                 
                Case "carga"
             
             
                 
                  Dim tipo_i As List
                  tipo_i= parser.NextArray 'returns a list with maps
               
               
                For i = 0 To tipo_i.Size - 1
                 
                 
                    Dim m As Map
                    m = tipo_i.Get(i)
                 
                             
                     
                    respuesta= m.Get("respuesta")
                    nombre= m.Get("nombre")
                 
                                         
                    Log("TOTAL"& respuesta)
                 
                 
                                     
                    If (respuesta="validado") Then
                     
                      'accion
                     
                       end if
                 
                 
                 
                 
                 
                    If (respuesta="noregistrado") Then
                                             
                           'accion
             
                    End If
                 
                 
                 
                 
                 
             
                    m.Clear 
                Next
             
             
                ProgressDialogHide
         
               
     
                 
        End Select
 
     
 
     
    End If
    Job.Release
 
 
 
 
 
End Sub


then turn off the httputils2 libraries and mark the two libraries okhttp v1.01 and v2.20 okhttputils

compiles and runs ok. but when requesting data, marks the error.


B4X:
RUTA :
http://servicios.xxx.cl/xxxx/script/mialrededor.php?latitud=-33.60210022889078&longitud=-70.86914520710707

java.lang.NoClassDefFoundError: anywheresoftware.b4a.objects.ServiceHelper$StarterHelper
    at anywheresoftware.b4a.samples.httputils2.httputils2service.onCreate(httputils2service.java:48)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2414)
    at android.app.ActivityThread.access$1700(ActivityThread.java:140)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1319)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)

[/CODE]

thanks to all
 
Top