Android Question App isn't responding

edgar_ortiz

Active Member
Licensed User
Longtime User
Hi,

I have a small project to capture the GPS position every 5 minutes.

But it's NOT working. sometimes hang (stop working) and other the services don't keep alive.

Any help is welcome.

Regards,

Edgar

P.D.:
Rename database.txt to database.db3
 

Attachments

  • Screenshot_20170122-004721.png
    138.6 KB · Views: 413
  • database.txt
    240 KB · Views: 354
  • GPS_Clientes.zip
    172.5 KB · Views: 305

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. You need to use PhoneWakeState to acquire a partial lock if you want to keep the service running.
2. Remove any calls to DoEvents.
3. You need to find out which code causes the main thread to freeze. Close the app when you see the ANR dialog it should print more information in the logs.
Make sure to test it in release mode.
 
Upvote 0

edgar_ortiz

Active Member
Licensed User
Longtime User

Thanks for your advice... I'll try
 
Upvote 0

edgar_ortiz

Active Member
Licensed User
Longtime User
Hi,

I Try and found this information in the logs (of course I don't have any idea of what it means).



Note that the zip file in the original post is updated.

Any help is welcome.

Thanks in advance,

Edgar
 

Attachments

  • log 2017 01 25.txt
    9.1 KB · Views: 321
Upvote 0

edgar_ortiz

Active Member
Licensed User
Longtime User
Hi,

I made more "simple" "write_log"... and crash AGAIN

B4X:
Sub Write_Log (ParamPrograma As String, ParamInfo As String)
    Dim lcSqlComando As String
    Dim lcFecha As String
    '
    lcFecha = NumberFormat2(DateTime.GetYear(DateTime.Now),4,0,0,False) & "-" & _
                            NumberFormat2(DateTime.GetMonth(DateTime.Now),2,0,0,False) & "-" & _
                            NumberFormat2(DateTime.GetDayOfMonth(DateTime.Now),2,0,0,False) & " " & _
                            NumberFormat2(DateTime.GetHour(DateTime.Now),2,0,0,False) & ":" & _
                            NumberFormat2(DateTime.GetMinute(DateTime.Now),2,0,0,False) & ":" & _
                            NumberFormat2(DateTime.GetSecond(DateTime.Now),2,0,0,False)
    '
    lcSqlComando = "INSERT INTO sg_t_log (programa, fecha_hora, info) values (" & _
                                "^XXParamProgramaXX^," & _
                                "^" & lcFecha & "^, " & _
                                "^XXParamInfoXX^)"
    lcSqlComando    = lcSqlComando.Replace("XXParamProgramaXX", ParamPrograma)
    lcSqlComando    = lcSqlComando.Replace("XXParamInfoXX", ParamInfo)
    lcSqlComando    = lcSqlComando.Replace("^", Main.GlbComillas)
    Main.DBGPS.ExecNonQuery(lcSqlComando)
    '
End Sub

and logs says:



Again, any help is welcome.

Regards,

Edgar

P.D.:
Project ZIP is updated.
 

Attachments

  • Crash Log.png
    120.4 KB · Views: 387
Upvote 0

edgar_ortiz

Active Member
Licensed User
Longtime User
Hi,

I'm sorry... I'm in a "loop" (it's 1:11 AM and 16+ hours of work)



How I read logs in the IDE in release mode?
 
Upvote 0

edgar_ortiz

Active Member
Licensed User
Longtime User
Hi,

The "Starter" service send me:



Any help is welcome,

Regards,

Edgar
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…