Android Question Can CallSubDelayed3 calls be lost?

SteveTerrell

Active Member
Licensed User
Longtime User
Latest B4a

I have an app with an activity and a service. The activity has a sub (in a class) that is called as a result of a button click, or a timer tick or something happening in the service (Bluetooth data received). Under the case I am working on at the moment the Activity is not paused - but under some circumstances could be.

I have been using CallSubDelayed3(...) in all three cases, the parameters specify the reason for the call so the sub can respond to the user, timeout something or display a message from the Bluetooth.

This generally works but there are occasions where the call from the service does not result in the sub running. I can tell this by logging each run of the sub and displaying the reason for the run (one of the parameters) and by logging the line before each callsubdelayed3 to see that it is executed and the request to run made.

The problem appears to be timing related and happens perhaps 25% of the time and seems to be related to my clicking the button just after the service has executed the callsubdelayed3 but before the sub has actually run as a result of that call. This is under the rapid debugger which does slow things down a bit and probably increases the time delay before the sub runs. The sub run requested by the service never happens but the button click run request does.

I assume i am correct to expect all callsubdelayed runs to result in execution of the target sub? (remembering the activity is not paused).

The target sub exists and runs as expected most of the time irrespective of the source of the callsubdelayed so it is not a call to a non-existent sub (which i do check for).

If it should work is there any way i can find out what is actually happening? (check the callsubdelayed stack perhaps?)

I have replaced the callsubdelayed3 calls with simple callsub3's and have not seen the problem since then. This has changed the timing so may not be a good fix. I think for other reasons that CallSubDelayed3 would be better so would really like to use that approach.



Steve
 

SteveTerrell

Active Member
Licensed User
Longtime User
I do have quite a complex project so will experiment a bit more to try and understand what is happening.

Thanks for the reply, Steve
 
Upvote 0

SteveTerrell

Active Member
Licensed User
Longtime User
I know this is not what you really need but it is some information

Here is the calling code.
B4X:
        TrsBluetoothService.LoggerService.LogInformation("before call","Module:"&Module&"Sub"&StateCode&" function:"&requestMessageCode&" State:"&state)
        CallSubDelayed3(Module, StateCode, requestMessageCode, currentMessage.work)
        TrsBluetoothService.LoggerService.LogInformation("after call","Module:"&Module&"Sub"&StateCode&" function:"&requestMessageCode&" State:"&state)

The "TrsBluetoothService.LoggerService.LogInformation" is my logging mechanism to txt file and screen.

Here is the start of the sub.
B4X:
Sub SurveyManagerCode(event As Int, data As Object)

    TrsBluetoothService.LoggerService.LogInformation("sm run",event)

Here is part of the resulting log (not edited within the shown section).

B4X:
*12:01:01:551::I:sm run:-1
*12:01:01:810::I:sm run:-1
*12:01:02:072::I:before call:Module:class trs.Mk2ResistanceMeter.mainSubSurveyManagerCode function:104 State:1
*12:01:02:072::I:after call:Module:class trs.Mk2ResistanceMeter.mainSubSurveyManagerCode function:104 State:1
*12:01:02:079::I:sm run:-1
*12:01:02:364::I:sm run:-1
*12:01:02:415::I:sm run:104
*12:01:02:425::I:SurveyManagerCode:Manual log requested, myBool is false
*12:01:02:440::I:accept simple, no stacked work :work state was 1 stack 0
*12:01:02:440::I:SurveyManagerCode::: 1->1004
*12:01:02:528::I:sm run:58
*12:01:02:583::I:SurveyManagerCode:reply - to True
*12:01:02:806::I:sm run:-1
*12:01:02:835::I:SurveyManagerCode::: 1004->1005
*12:01:02:990::I:sm run:-1
*12:01:03:100::I:manualLogManagerCode::: 0->1 Send A0
*12:01:03:304::I:sm run:-1
*12:01:03:521::I:sm run:-1
*12:01:03:580::T:BtSimManagerCode:Start logging as A0
*12:01:03:919::I:manualLogManagerCode::: 1->2
*12:01:04:233::I:manualLogManagerCode::: 2->0 Got a V
*12:01:04:238::I:sm run:-18
*12:01:04:669::I:SurveyManagerCode::: 1005->1
*12:01:04:928::I:sm run:-1
*12:01:05:148::I:sm run:-1
*12:01:05:400::I:sm run:-1
*12:01:05:688::I:sm run:-1
*12:01:05:960::I:sm run:-1
*12:01:06:033::I:before call:Module:class trs.Mk2ResistanceMeter.mainSubSurveyManagerCode function:104 State:1
*12:01:06:034::I:after call:Module:class trs.Mk2ResistanceMeter.mainSubSurveyManagerCode function:104 State:1
*12:01:06:119::I:sm run:58
*12:01:06:374::I:sm run:-1
*12:01:06:558::I:sm run:-1
*12:01:06:845::I:sm run:-1
*12:01:07:093::I:sm run:-1
*12:01:07:386::I:sm run:-1
*12:01:07:586::I:sm run:58
*12:01:07:890::I:sm run:-1

At 12:01:02:072 there is a call that worked, 12:01:02:415 shows the correct function 104 arriving in the sub.
(The sm run lines are from the sub.)
The -1 functions are timer calls (CallSub3), function 58 is a message from the Bluetooth service (CallSubDelayed3).
The SurveyManagerCode works through its state machine as does the manualLogManager and the BtSimManagerCode and at 12:01:04:669 it is in state 1 ready for another button click call (the 104 function).

At 12:01:06:033 the call from the button routing happens again. A call from the service routine (58) arrives quite close to the "before" and "after" sequence, timer calls arrive but the 104 function call never arrives.

The above run was under the rapid debugger. This lost call happens 10-20% of the time.

I have repeated this under the legacy debugger, where the code executes much faster so the timing is different, and it has not happened in about 60 button clicks.
Here is an example from the legacy debugger. There is not really time for anything else to get in between the 104 call and its execution.
B4X:
*12:05:20:616::I:sm run:-1
*12:05:20:741::I:sm run:-1
*12:05:20:744::I:sm run:58
*12:05:20:866::I:sm run:-1
*12:05:20:991::I:sm run:-1
*12:05:21:116::I:sm run:-1
*12:05:21:139::I:before call:Module:class trs.Mk2ResistanceMeter.mainSubSurveyManagerCode function:104 State:1
*12:05:21:140::I:after call:Module:class trs.Mk2ResistanceMeter.mainSubSurveyManagerCode function:104 State:1
*12:05:21:142::I:sm run:104
*12:05:21:143::I:SurveyManagerCode:Manual log requested, myBool is true
*12:05:21:144::I:accept simple, no stacked work :work state was 1 stack 0
*12:05:21:145::I:SurveyManagerCode::: 1->1004
*12:05:21:241::I:sm run:-1
*12:05:21:242::I:SurveyManagerCode::: 1004->1005
*12:05:21:244::I:manualLogManagerCode::: 0->1 Send A0
*12:05:21:245::T:BtSimManagerCode:Start logging as A0
*12:05:21:247::I:manualLogManagerCode::: 1->2
*12:05:21:264::I:manualLogManagerCode::: 2->0 Got a V
*12:05:21:265::I:sm run:-18
*12:05:21:363::I:SurveyManagerCode::: 1005->1
*12:05:21:388::I:sm run:-1
*12:05:21:389::I:sm run:58
*12:05:21:513::I:sm run:-1
*12:05:21:637::I:sm run:-1
*12:05:21:762::I:sm run:-1
*12:05:21:888::I:sm run:-1
*12:05:21:890::I:sm run:58
*12:05:21:953::I:before call:Module:class trs.Mk2ResistanceMeter.mainSubSurveyManagerCode function:104 State:1
*12:05:21:953::I:after call:Module:class trs.Mk2ResistanceMeter.mainSubSurveyManagerCode function:104 State:1
*12:05:21:955::I:sm run:104
*12:05:21:955::I:SurveyManagerCode:Manual log requested, myBool is true
*12:05:21:956::I:accept simple, no stacked work :work state was 1 stack 0
*12:05:21:956::I:SurveyManagerCode::: 1->1004
*12:05:22:014::I:sm run:-1
*12:05:22:014::I:SurveyManagerCode::: 1004->1005
*12:05:22:015::I:manualLogManagerCode::: 0->1 Send A0
*12:05:22:016::T:BtSimManagerCode:Start logging as A0
*12:05:22:017::I:manualLogManagerCode::: 1->2
*12:05:22:019::I:manualLogManagerCode::: 2->0 Got a V
*12:05:22:019::I:sm run:-18
*12:05:22:118::I:SurveyManagerCode::: 1005->1
*12:05:22:138::I:sm run:-1
*12:05:22:263::I:sm run:-1
*12:05:22:398::I:sm run:-1
*12:05:22:400::I:sm run:58
*12:05:22:523::I:sm run:-1
*12:05:22:648::I:sm run:-1
*12:05:22:719::I:before call:Module:class trs.Mk2ResistanceMeter.mainSubSurveyManagerCode function:104 State:1
*12:05:22:720::I:after call:Module:class trs.Mk2ResistanceMeter.mainSubSurveyManagerCode function:104 State:1
*12:05:22:721::I:sm run:104
*12:05:22:722::I:SurveyManagerCode:Manual log requested, myBool is true
*12:05:22:723::I:accept simple, no stacked work :work state was 1 stack 0
*12:05:22:724::I:SurveyManagerCode::: 1->1004
*12:05:22:789::I:sm run:-1
*12:05:22:790::I:SurveyManagerCode::: 1004->1005
*12:05:22:792::I:manualLogManagerCode::: 0->1 Send A0
*12:05:22:794::T:BtSimManagerCode:Start logging as A0
 
Upvote 0

SteveTerrell

Active Member
Licensed User
Longtime User
Ok, thanks for your help.

It will be really useful for me if it can be fixed some time. The lost call stalls my state machine and then my program.
It would be good to be able to keep using the rapid debugger because it is better at examining variables than the legacy debugger and of course has the quick code change facility.

Steve
 
Upvote 0

SteveTerrell

Active Member
Licensed User
Longtime User
I will see what i can do.

Just for information, this still happens in the latest release of B4A when the rapid debugger is used (via bridge).
All calls are executed with the legacy debugger/release version of the program. And all calls are executed if CallSub3 is used.

In this case (which is unfortunately too complex for a simple example) it was related to receiving data (uart characters) from BLE2 and passing them on for processing in a class method (which could also be called by a timer routine). All characters (service + characteristics) were received in the Manager_DataAvailable sub but the callsubdelayed in that sub to pass them on did not always result in the character arriving at the destination sub (i.e. the sub did not always run). Characters before and after did result in the destination running.

It is likely that there were a number of callsubdelayed calls queued. There was nothing in the filtered log to say that a call had failed.

Steve
 
Upvote 0

Mikonios

Active Member
Licensed User
Longtime User
Have the same problem ::

B4X:
Sub X55_MainEntra(VieneDe As String, Resultado As String)


    Select VieneDe
 
        Case "X55_DownUpdteSale"
            Csr.LogMemory1("   X55_MainEntra Finalizado DownUpdte: "  & Resultado , "3")
            CallSubDelayed3("DownCombus", "X00_DownCombusEntra",        "Main;X55_MainEntra;", "")
            DoEvents
         
        Case "X55_DownCombusSale"
            Csr.LogMemory1("   X55_MainEntra Finalizado DownCombus: " & Resultado , "3")
         
            If Resultado.IndexOf("YaActualizado") >= 0 OR _
                    Resultado.IndexOf("NoConecction") >= 0 Then
                 
                X60_MainSalir("Finalizado. " & Resultado )                 
                ExitApplication
            Else
                CallSubDelayed3("DownElect",  "X00_DownElectEntra",    "Main;X55_MainEntra;", "")         
                DoEvents
            End If
         
        Case "X55_DownElectSale"
            Csr.LogMemory1("   X55_MainEntra Finalizado DownElect: "  & Resultado , "3")
            CallSubDelayed3("IpExternal",    "X00_IpExternaEntra",        "Main;X55_MainEntra;", "")
            DoEvents
         
        Case "X55_IpExternaSale"
            Csr.LogMemory1("   X55_MainEntra Finalizado IpExterna: "  & Resultado , "3")
            CallSubDelayed3("DownTA",         "X00_DownTAEntra",            "Main;X55_MainEntra;", "")
            DoEvents
         
        Case "X55_DownTASale"
            Csr.LogMemory1("   X55_MainEntra Finalizado DownTA: "  & Resultado , "3")
            CallSubDelayed3("DownClima",    "X00_DownClimaEntra",        "Main;X55_MainEntra;", "")
            DoEvents
         
        Case "X55_DownClimaSale"
            Csr.LogMemory1("   X55_MainEntra Finalizado DownClima: "  & Resultado , "3")
            CallSubDelayed3("DownClimaAcu",  "X00_DownClimaAcuEntra",    "Main;X55_MainEntra;", "")
            DoEvents
         
        Case "X55_DownClimaAcuSale"
            Csr.LogMemory1("   X55_MainEntra Finalizado DownClimaAcu: "  & Resultado , "3")
            CallSubDelayed3("DownClimaAcW",  "X00_DownClimaAcWEntra",    "Main;X55_MainEntra;", "")
            DoEvents
         
        Case "X55_DownClimaAcWSale"
            Csr.LogMemory1("   X55_MainEntra Finalizado DownClimaAcW: "  & Resultado , "3")
            
'            CallSubDelayed3("IpExternal",    "X00_IpExternaEntra",        "Main;X55_MainEntra;", "")
            CallSubDelayed3("SndMyFtp",        "X00_SndMyFtpEntra",        "Main;X55_MainEntra;", "")
            DoEvents

        Case "X55_SndMyFtpSale"
            Csr.LogMemory1("   X55_MainEntra Finalizado SndMyFtp: "  & Resultado , "3")
            CallSubDelayed3("SndMyMail",    "X00_SndMyMailEntra",        "Main;X55_MainEntra;", "")


        Case "X55_SndMyMailSale"
            Csr.LogMemory1("   X55_MainEntra Finalizado SndMyMail: "  & Resultado , "3")
            X60_MainSalir(Resultado)

    End Select
 
'    DoEvents        ' Si lo pongo detiene el proceso SendMail
End Sub



B4X:
Sub X55_SndMyFtpSale(Resultado As String)

    FTP1.Close 
    FTP1.CloseNow
    If Main.ActivLog Then Csr.LogMemory1("   X55_SndMyFtpSale ........ " & Resultado, "3")
 
    CallSubDelayed3(ModuloRet, SubRet, "X55_SndMyFtpSale", Resultado)
'    CallSub3(ModuloRet, SubRet, "X55_SndMyFtpSale", Resultado)
    Activity.finish
     
End Sub

When he returns to Main, it stops in 'pause' or 'resume' and not continuous. Why ????

2016-04-27:070302: Pocess: BBDDCreaTblLog ...
2016-04-27:070303: Pocess: Main Activity_Pause
2016-04-27:070303: Pocess: X00_SndMyFtpEntra ..........
2016-04-27:070303: Pocess: CheckConnection MiIpWiFi:192.168.1.111:true
2016-04-27:070303: Pocess: X02_SubeFtpIp.EnviandoA:: (192.168.1.1:23:\mnt\ST3300831A\ST300GbIDE\x00-Ftp....\....\DownLoad\
2016-04-27:070303: Pocess: X02_SubeFtpIp.Cifrado:: (false), 23, ...
2016-04-27:070307: Pocess: FTP_UploadCompleted :: UploadFtpOk
2016-04-27:070308: Pocess: FTP_ListCompleted :: (10) Ok
2016-04-27:070308: Pocess: X02_SubeFtpIp.EnviandoA:: (192.168.1.113:4113:/mnt/sdcard/Ftp..../..../DownLoad/
2016-04-27:070308: Pocess: X02_SubeFtpIp.Cifrado:: (false), 4113, ....
2016-04-27:070319: Pocess: FTP_UploadCompleted :: UploadFtpOk
2016-04-27:070319: Pocess: FTP_ListCompleted :: (10) Ok
2016-04-27:070319: Pocess: X02_SubeFtpIp.EnviandoA:: (192.168.1.114:4114:/mnt/sdcard/Ftp..../..../DownLoad/
2016-04-27:070319: Pocess: X02_SubeFtpIp.Cifrado:: (false), 4114, ....
2016-04-27:070331: Pocess: FTP_UploadCompleted :: UploadFtpOk
2016-04-27:070332: Pocess: FTP_ListCompleted :: (10) Ok
2016-04-27:070332: Pocess: X55_SndMyFtpSale ........ UploadFtpEndOk
2016-04-27:070332: Pocess: Main Activity_Resume
2016-04-27:070332: Pocess: Main Activity_Pause
2016-04-27:070651: Pocess: Main Activity_Resume
2016-04-27:074501: Pocess: Main Activity_Pause
 
Last edited:
Upvote 0

Mikonios

Active Member
Licensed User
Longtime User
When other modules are returned to the main_activity, none passes 'pause', 'resume'- Instead returning from SndMyFtpSale and SndMyMailSale the porcess enter in thats sub, and do not understand why this difference.

2016-04-28:013022: Pocess: X55_DownCombusSale ... X34_BBDDCreaTblImg. Ok
2016-04-28:013022: Pocess: X55_MainEntra Finalizado DownCombus: X34_BBDDCreaTblImg. Ok
2016-04-28:013024: Pocess: X00_DownElectEntra (14')....
2016-04-28:013024: Pocess: CheckConnection MiIpWiFi:192.168.1.111:true
2016-04-28:013024: Pocess: DownElect X55_DownElectSale ...: MenosDe15Dias:20160428:20160509
2016-04-28:013024: Pocess: X55_MainEntra Finalizado DownElect: DownElect X55_DownElectSale: MenosDe15Dias:20160428:20160509
2016-04-28:013024: Pocess: X00_IpExternaEntra..........
2016-04-28:013024: Pocess: CheckConnection MiIpWiFi:192.168.1.111:true
2016-04-28:013025: Pocess: X55_IpExternaSale ... .............
2016-04-28:013025: Pocess: X55_MainEntra Finalizado IpExterna: ..........
2016-04-28:013026: Pocess: X00_DownTAEntra 1,5 min......
2016-04-28:013026: Pocess: CheckConnection MiIpWiFi:192.168.1.111:true
2016-04-28:013117: Pocess: DownTA X55_DownTASale ...: Obras/LatLng/Tot = 272/272/272
2016-04-28:013117: Pocess: X55_MainEntra Finalizado DownTA: DownTA X55_DownTASale: Obras/LatLng/Tot = 272/272/272
2016-04-28:013117: Pocess: X00_DownClimaEntra 3sg..........
2016-04-28:013117: Pocess: CheckConnection MiIpWiFi:192.168.1.111:true
2016-04-28:013117: Pocess: X01_CreaTblyCargaProvLatLng ..........
2016-04-28:013123: Pocess: DownClima X55_DownClimaSale ...: NroClima: 52
2016-04-28:013123: Pocess: X55_MainEntra Finalizado DownClima: DownClima X55_DownClimaSale: NroClima: 52
2016-04-28:013124: Pocess: X00_DownClimaAcuEntra 3sg..........
2016-04-28:013124: Pocess: CheckConnection MiIpWiFi:192.168.1.111:true
2016-04-28:013124: Pocess: JobCliAcu. Err no controlado Unauthorized
2016-04-28:013124: Pocess: DX55_DownClimaAcuSale ...: Unauthorized
2016-04-28:013124: Pocess: X55_MainEntra Finalizado DownClimaAcu: X55_DownClimaAcuSale: Unauthorized
2016-04-28:013124: Pocess: X00_DownClimaAcWEntra 3sg..........
2016-04-28:013124: Pocess: CheckConnection MiIpWiFi:192.168.1.111:true
2016-04-28:013151: Pocess: X55_DownClimaAcWSale ...: Ok 52
2016-04-28:013151: Pocess: X55_MainEntra Finalizado DownClimaAcW: X55_DownClimaAcWSale: Ok 52
2016-04-28:013151: Pocess: X051_CorrigeHistorico...Corrigiendo(4 min aprox)
2016-04-28:013525: Pocess: X051_CorrigeHistorico .. NroReg: 10042
2016-04-28:013525: Pocess: X054_ReduceHistorico ...Reduciendo(3 min aprox)
2016-04-28:013813: Pocess: X054_ReduceHistorico ..Reducido con NroReg: 10042


with this modification sometimes get to continue the process and not to stop, but not always work ::::

B4X:
Sub Activity_Pause (UserClosed As Boolean)
    DoEvents
    Csr.LogMemory1("   Main Activity_Pause", "3")
End Sub

Sub Activity_Resume
    DoEvents
    Csr.LogMemory1("   Main Activity_Resume", "3")
End Sub
 
Upvote 0

Mikonios

Active Member
Licensed User
Longtime User
Below you can see the log after the last modification. The full execution process ends.
You can see the difference between modules activity.
When Ftp returns to the main launch Resume.Sub.Pause
When Mail returns to the main launch Resume.Sub
When the other modules return to the main go directly to Sub.


.../...
2016-04-29:014641: Pocess: BBDDCreaTblLog ...
2016-04-29:014641: Pocess: Main Activity_Pause
2016-04-29:014641: Pocess: X00_SndMyFtpEntra ..........
2016-04-29:014641: Pocess: CheckConnection MiIpWiFi:192.168.1.111:true
2016-04-29:014641: Pocess: X02_SubeFtpIp.EnviandoA:: (192.168.1.1:23:\mnt\ST3300831A\ST300GbIDE\x00-..\..\DownLoad\
2016-04-29:014641: Pocess: X02_SubeFtpIp.Cifrado:: (false), 23, ....
2016-04-29:014641: Pocess: FTP_UploadCompleted :: Err
2016-04-29:014641: Pocess: Err:192.168.1.1:23(....)\mnt\ST3300831A\ST300GbIDE\x00-Ftp..\...\DownLoad\20160429014641....db
2016-04-29:014641: Pocess: 530 Not logged in, home directory does not exist.
2016-04-29:014641: Pocess: X02_SubeFtpIp.EnviandoA:: (192.168.1.113:4113:/mnt/sdcard/Ftp.../.../DownLoad/
2016-04-29:014641: Pocess: X02_SubeFtpIp.Cifrado:: (false), 4113, ....
2016-04-29:014654: Pocess: FTP_UploadCompleted :: UploadFtpOk
2016-04-29:014654: Pocess: FTP_ListCompleted :: (10) Ok
2016-04-29:014654: Pocess: X02_SubeFtpIp.EnviandoA:: (192.168.1.114:4114:/mnt/sdcard/Ftp../../DownLoad/
2016-04-29:014654: Pocess: X02_SubeFtpIp.Cifrado:: (false), 4114, ....
2016-04-29:014709: Pocess: FTP_UploadCompleted :: UploadFtpOk
2016-04-29:014709: Pocess: FTP_ListCompleted :: (10) Ok
2016-04-29:014709: Pocess: X55_SndMyFtpSale ........ UploadFtpEndOk
2016-04-29:014709: Pocess: Main Activity_Resume
2016-04-29:014710: Pocess: X55_MainEntra Finalizado SndMyFtp: UploadFtpEndOk
2016-04-29:014710: Pocess: Main Activity_Pause

2016-04-29:014710: Pocess: X00_SndMyMailEntra..........
2016-04-29:014710: Pocess: CheckConnection MiIpWiFi:192.168.1.111:true
2016-04-29:014710: Pocess: BBDDReImportTblLog ...
2016-04-29:014710: Pocess: TablaImport (____1)....db[15.23MB] <- 04Log__________ Idx(0)
2016-04-29:014710: Pocess: TablaImport (____1)....db[15.23MB] <- 09Fecha________ Idx(0)
2016-04-29:014710: Pocess: TablaImport (____3)....db[15.23MB] <- 09FechaNew_____ Idx(0)
2016-04-29:014710: Pocess: TblImportCf (____1)....db[18.33MB] <- 04Log__________ Idx(0)
2016-04-29:014710: Pocess: TblImportCf (____1)....db[18.33MB] <- 09Fecha________ Idx(0)
2016-04-29:014710: Pocess: TblImportCf (____3)....db[18.33MB] <- 09FechaNew_____ Idx(0)
2016-04-29:014710: Pocess: X02_SendBBDD... Estado Cifrado :: false
2016-04-29:014710: Pocess: X02_SendBBDD... Enviando 20160429014710.....db
2016-04-29:014752: Pocess: SMTP_MessageSent Procesado y Enviado
2016-04-29:014752: Pocess: X55_SndMyMailSale ... SMTP_MessageSent. Proceso End Ok
2016-04-29:014752: Pocess: Main Activity_Resume
2016-04-29:014752: Pocess: X55_MainEntra Finalizado SndMyMail: SMTP_MessageSent. Proceso End Ok

2016-04-29:014752: Pocess: X60_MainSalir SMTP_MessageSent. Proceso End Ok
2016-04-29:014752: Pocess: X60_MainSalir Proceso Completo Ok
2016-04-29:014752: Pocess: Main Activity_Pause
2016-04-29:014752: Pocess: X00_SendMailEntra..........
2016-04-29:014752: Pocess: CheckConnection MiIpWiFi:192.168.1.111:true
2016-04-29:014752: Pocess: EnviandoResultadoProcesoA:
2016-04-29:014752: Pocess: [email protected], Ok, milog.log
2016-04-29:014753: Pocess: X55_SendMailSale ... SendMail Ok [email protected], Ok, milog.log
2016-04-29:014754: Pocess: Main Activity_Resume
2016-04-29:014754: Pocess: X61_MainFin
 
Upvote 0

Mikonios

Active Member
Licensed User
Longtime User
Modifyed. Created 3 Services.
Now, from Start to End proccess work fine. Show logs.
The problema now, after make Release versión to apk, when run no work !!

2016-05-01:145233: Pocess: Activity_Create...................................................
2016-05-01:145233: Pocess: Device: SM-N9005
2016-05-01:145235: Pocess: Main Activity_Resume
2016-05-01:145235: Pocess: Service_Create.FtpUpSrv ..........
2016-05-01:145235: Pocess: Service_Start.FtpUpSrv ..........
2016-05-01:145235: Pocess: CheckConnection MiIpWiFi:192.168.1.110:true
2016-05-01:145235: Pocess: X02_SubeFtpIp.EnviandoA:: (192.168.1.1:23:\mnt\ST3300831A\ST300GbIDE\x00-Ftp....\DownLoad\
2016-05-01:145235: Pocess: X02_SubeFtpIp.Cifrado:: (false), 23, ..
2016-05-01:145239: Pocess: FTP_UploadCompleted :: UploadFtpOk
2016-05-01:145239: Pocess: FTP_ListCompleted :: (10) Ok
2016-05-01:145239: Pocess: X02_SubeFtpIp.EnviandoA:: (192.168.1.113:4113:/mnt/sdcard/Ftp../../DownLoad/
2016-05-01:145239: Pocess: X02_SubeFtpIp.Cifrado:: (false), 4113, ..
2016-05-01:145307: Pocess: FTP_UploadCompleted :: UploadFtpOk
2016-05-01:145307: Pocess: FTP_ListCompleted :: (10) Ok
2016-05-01:145307: Pocess: X02_SubeFtpIp.EnviandoA:: (192.168.1.114:4114:/mnt/sdcard/Ftp../../DownLoad/
2016-05-01:145307: Pocess: X02_SubeFtpIp.Cifrado:: (false), 4114, ..
2016-05-01:145337: Pocess: FTP_UploadCompleted :: UploadFtpOk
2016-05-01:145337: Pocess: FTP_ListCompleted :: (10) Ok
2016-05-01:145337: Pocess: X55_SndMyFtpSale ........ UploadFtpEndOk
2016-05-01:145337: Pocess: X55_MainEntra Finalizado SndMyFtp: UploadFtpEndOk
2016-05-01:145338: Pocess: Service_Create.SmtoSndSrv ..........
2016-05-01:145338: Pocess: Service_Start.SmtoSndSrv ..........
2016-05-01:145338: Pocess: CheckConnection MiIpWiFi:192.168.1.110:true
2016-05-01:145338: Pocess: BBDDReImportTblLog ...
2016-05-01:145338: Pocess: TablaImport (____1)...db[15.03MB] <- 04Log__________ Idx(0)
2016-05-01:145338: Pocess: TablaImport (____1)...db[15.03MB] <- 09Fecha________ Idx(0)
2016-05-01:145338: Pocess: TablaImport (____3)...db[15.03MB] <- 09FechaNew_____ Idx(0)
2016-05-01:145338: Pocess: TblImportCf (____1)...db[18.12MB] <- 04Log__________ Idx(0)
2016-05-01:145338: Pocess: TblImportCf (____1)...db[18.12MB] <- 09Fecha________ Idx(0)
2016-05-01:145338: Pocess: TblImportCf (____3)..db[18.12MB] <- 09FechaNew_____ Idx(0)
2016-05-01:145338: Pocess: X02_SendBBDD... Estado Cifrado :: false
2016-05-01:145338: Pocess: X02_SendBBDD... Enviando 20160501145338....db
2016-05-01:145420: Pocess: SMTP_MessageSent Procesado y Enviado
2016-05-01:145420: Pocess: X55_SndMyMailSale ... SMTP_MessageSent. Proceso End Ok
2016-05-01:145420: Pocess: X55_MainEntra Finalizado SndMyMail: SMTP_MessageSent. Proceso End Ok
2016-05-01:145420: Pocess: Service_Create.SmtoSnd2Srv ..........
2016-05-01:145420: Pocess: Service_Start.SmtoSnd2Srv ..........
2016-05-01:145420: Pocess: CheckConnection MiIpWiFi:192.168.1.110:true
2016-05-01:145420: Pocess: EnviandoResultadoProcesoA:
2016-05-01:145420: Pocess: [email protected], Ok, milog.log
2016-05-01:145421: Pocess: X55_SendMail2Sale ... SendMail Ok [email protected], Ok, milog.log
2016-05-01:145421: Pocess: X61_MainFin.SendMail Ok ...com, Ok, milog.log



The problema now, after make Release versión to apk, when run no work !!
And no compiler error is generated. And I do not see that kind of error is being produced.
Reset Device. App uninstalled. Reinstall again. The same result.
Transfer the apk ftp, and install from the device itself. The same result.

Can't understand it !!!! Why ??? Version: 3.82
Need modify manifiest ??
Need modify anything ???

AppSeDetuvo.jpg



After many tests and modifications and compilations, detected the problem.
In the declaration of variables in "Sub Process_Globals" of a service, are not allowed definitions like this "Dim As String = Main.DirMCheck", but instead the compiler does not detect it.
But in any module activity it is allowed and does not generate errors or to compile or to run the apk. !!!

B4X:
Sub Process_Globals
       'These global variables will be declared once when the application starts.
       'These variables can be accessed from all modules.
       Dim SMTP1 As SMTP
'       'Dim DirSalida As String = Main.DirMCheck
       Dim MiModuloRet, MiSubRet, MiParametro0, MiParametro1 As String
End Sub
 
Last edited:
Upvote 0
Top