Android Question Intermittent application problem

jose luis gudino

Active Member
Licensed User
Longtime User
Hi, everyone, I have a problem that has become intermittent in my application,
Sometimes it appears and other times the application works without any problem, I will post an image to see if someone can give me a clue of what it is and another question, how can I know the line number where the error appears to check since it is the version release.
Thanks in advance

 
Last edited:

edgar_ortiz

Active Member
Licensed User
Longtime User
Inside the folder called "objects \ src", you will find several ".java" files, there should be one called "familiar", look inside it.

Your problem originates because you are using "NumberFormat" and the "string" to work is empty.
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
Hi Edgar, thank you for your prompt response, I will check and I will comment on the results
thank you
very grateful for your help !!!

muy agradecido por tu ayuda!!!
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Hi:

Could you post the code in the sub familiar?

It would be a good idea if you blur the phone number showed in the picture….
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
Hi:

Could you post the code in the sub familiar?

It would be a good idea if you blur the phone number showed in the picture….

Thanks for the suggestion, I already blurred it

B4X:
Public Sub ProcessData(res As String,job As HttpJob) As ResumableSub
    ProgressDialogHide
    If job.JobName="sendImgJob" Then
        ProgressDialogHide
        Log("FOTO ENVIADA")
        Log(job.GetString2("Windows-1252"))
        job.Release
        foto_perfil_familiar_lista = 1
        kvs.Put("foto_perfil_familiar_lista","1")
        btnShowAlertFOTO_Click
        job.Release
        Return
    End If
    If job.JobName="sendImgJob1" Then
        ProgressDialogHide
        Log("FOTO ENVIADA")
        Log(job.GetString2("Windows-1252"))
        job.Release
        foto_perfil_familiar_lista = 1
        kvs.Put("foto_perfil_familiar_lista","1")
        btnShowAlertFOTO_Click
        job.Release
        Panel_tabla.Visible = False
        Return
    End If
    If job.Success Then
        Dim ubica As Int
        Dim strVar As String
        Dim sf As StringFunctions
        ubica = res.IndexOf("[")
        sf.Initialize
        strVar = sf.Left(res,ubica)
        res= res.Replace (strVar, "")
        Log("Response from server: " & res)
        Select job.JobName
            Case GUARDARDATOS
                Dim parser As JSONParser
                parser.Initialize(res)
                Dim DATOS As List
                DATOS = parser.NextArray 'returns a list with maps
                If DATOS.Size > 0 Then
                    
                Else
                    
                End If
                CREA_TU_PERFIL.datos_familiar_listo_reset = 1
                timer1.Initialize("Timer1", 3000)
                timer1.Enabled = True
                kvs.Put("datos_familiar_listo","1")
                IME.HideKeyboard
                btnShowAlertColoured_Click
                
            Case DATOSUSUARIO
                ProgressDialogHide
                Dim parser As JSONParser
                parser.Initialize(res)
                Dim DATOS As List
                DATOS = parser.NextArray 'returns a list with maps
                ProgressDialogHide
                If DATOS.Size > 0 Then
                    For i = 0 To DATOS.Size - 1
                        Dim m As Map
                        m = DATOS.Get(i)
                        B4XFloatTextField_nombre.Text = m.Get("c_nombre_familiar")
                        B4XFloatTextField_apellido.Text = m.Get("c_apellido_familiar")
                        B4XFloatTextField_email.Text = m.Get("c_correo_familiar")
                        B4XFloatTextField_cedula.Text = m.Get("c_cedula")
                        'AnotherDatePicker_fecha_nacim.Date = m.Get("d_fecha_nacimiento") * 1000
                        DateTime.DateFormat ="dd/MM/yyyy"
                        B4XFloatTextField_fecha.Text = DateTime.Date(m.Get("d_fecha_nacimiento") * 1000)
                        B4XFloatTextField_ciud_residencia.Text = m.Get("c_ciudad_residencia")
                        B4XFloatTextField_direccion.Text = m.Get("c_direccion_residencia")
                        B4XFloatTextField_dir_trabajo.Text = m.Get("c_direccion_trabajo")
                        B4XFloatTextField_empresa.Text = m.Get("c_empresa")
                        B4XFloatTextField_cargo.Text = m.Get("c_cargo")
                        B4XFloatTextField_celular.Text = m.Get("c_celular")
                        B4XFloatTextField_num_fijo.Text = m.Get("c_telefono_residencia")
                        B4XFloatTextField_parentesco.Text = m.Get("c_parentesco")
                        Desabilitar_Editar
                    Next
                Else
                End If
            Case CIUDADES
                ProgressDialogHide
                Dim parser As JSONParser
                parser.Initialize(res)
                Dim DATOS As List
                DATOS = parser.NextArray 'returns a list with maps
                ProgressDialogHide
                If DATOS.Size > 0 Then
                    Spinner_ciudad.Clear
                    map_ciudades.Clear
                    For i = 0 To DATOS.Size - 1
                        Dim m As Map
                        m = DATOS.Get(i)
                        Dim ciudad = m.Get("nombre_ciudad") As String
                        Dim id_ciudad = m.Get("id_ciudad") As String
                        Spinner_ciudad.Add(m.Get("nombre_ciudad"))
                        map_ciudades.Put(ciudad,id_ciudad)
                        map_posic_ciudades.Put(id_ciudad,i)
                    Next
                Else
                End If
                Dim aux = Main.id_ciudad_publica As Int
                Spinner_ciudad.SelectedIndex =aux -1
                mostrar_datos
            Case BUSCAR_ID
                Dim parser As JSONParser
                parser.Initialize(res)
                Dim DATOS As List
                DATOS = parser.NextArray 'returns a list with maps
                If DATOS.Size > 0 Then
                    For i = 0 To DATOS.Size - 1
                        Dim m As Map
                        m = DATOS.Get(i)
                        INGRESO.ID_USUARIO = m.Get("id_cliente")
                    Next
                    
                End If
        
            Case ID_CREDITO_SOLIC
                Dim parser As JSONParser
                parser.Initialize(res)
                Dim DATOS As List
                DATOS = parser.NextArray 'returns a list with maps
                If DATOS.Size > 0 Then
                    For i = 0 To DATOS.Size - 1
                        Dim m As Map
                        m = DATOS.Get(i)
                        id_credito_aux = m.Get("id_credito_solicitado")
                    Next
                    
                End If
        End Select
    Else
        ToastMessageShow("Error: " & job.ErrorMessage, True)
    End If
    
    job.Release
End Sub
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
Hi Edgar,
Thanks for the help, I attach the requested information
regards
 

Attachments

  • familiar.java
    150.9 KB · Views: 219
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
Hi Jose Luis,

Does the error still occur on the same Java line (2720) number?

Regards

Edgar
As I mentioned, it is an "intermittent" error, the application works without problems. but suddenly the error appears, that is, we can fill 2 or 3 forms without problems and suddenly it fails. especially when you move the application to the background and return to the application again and that message appears on that line, but there I do not see anything related to that error
 
Upvote 0

edgar_ortiz

Active Member
Licensed User
Longtime User

I asked you because every time the application is "generated" the file "familiar.java" is changed.

Try to change:

B4X:
                Dim aux = Main.id_ciudad_publica As Int
                Spinner_ciudad.SelectedIndex =aux -1

For:

B4X:
log("Main.id_ciudad_publica")
log(Main.id_ciudad_publica)
Dim aux As Int = 0
If Main.id_ciudad_publica > 0 Then
    aux = Main.id_ciudad_publica - 1
Endif
Spinner_ciudad.SelectedIndex =aux

Regards

Edgar
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User


Edgar excellent, let me try
what would be the suspicion? that the variable for some reason loses its value?
I'm going to do what you tell me and I try
something else, the strangest thing is that on my phone I cannot simulate the error, but when the application is manipulated by clients if this error appears, I have not managed to make it appear, that is why I am upside down
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…