iOS Question Debug - Releas

stari

Active Member
Licensed User
Longtime User
i have tested App in debug mode and all is working.
My code:
In therapy class module i have timer, 1000 ms

B4X:
Sub timer1_tick

    Log(tconst &  "   " & DateTime.Time(DateTime.Now))
    Log("Headset state:  " & Main.con_head)

    If Main.con_head = False Then
        MediaPlayer1.Stop
        tconst = 0
        Main.krogec_text("continue")      
        timer1.Enabled = False
        Return
    End If


    If play_state = False Then        'ustavi impulze
        MediaPlayer1.Stop
            timer1.Enabled = False
        tconst = 0
        Main.krogec_text(Main.napis_krog(0))      
        Return
    End If

        Dim t As Long = Max(0,targetTime - DateTime.Now)
    'Log ("t = : " & t)
    Dim  hours, minutes, seconds As Int
    hours = t / DateTime.TicksPerHour
    minutes = (t Mod DateTime.TicksPerHour) / DateTime.TicksPerMinute
    seconds = (t Mod DateTime.TicksPerMinute) / DateTime.TicksPerSecond
    Dim ura_text As String = $"$2.0{hours}:$2.0{minutes}:$2.0{seconds}"$
    Log(ura_text)
      
                For x = 0 To 5
                    Main.napis_time_down(x).Text = ura_text
                Next

    trajanje = trajanje + 1


In Main i have:
B4X:
Dim napis_time_down(4) As Label[CODE]

In napis_time_down i shoe time remaining to end of therapy.
But, in debug mode this is working, in release mode the napis_time_down is not "refreshed".
If i wish to hide the label, i have:

[CODE]
for x = 0 to 5
Main.napis_time_down(x).Visible = False

Also this is working. Only updating the label will not work in release mode.
 
Last edited:

stari

Active Member
Licensed User
Longtime User
B4X:
        napis_time_down(stran).Initialize("napis_time_down")
        Dim  ntd_top As Int
        Dim napis_spodaj_spodaj As Int = zgoraj + visina
        ntd_top = (napis_spodaj_spodaj + (napis_spodaj(stran).Top - napis_spodaj_spodaj) / 2) - 15dip            '15dip je polovica okvircka za odstevanje
        'Log("Zgoraj: " & zgoraj & "  Visina: " & visina)
        'Log("Napis sredina bottom: " & napis_spodaj_spodaj & "  ND TOP : " & ntd_top & "  Napis spodaj TOP: " & napis_spodaj(stran).Top)
        strani(stran).RootPanel .AddView(napis_time_down(stran),0,ntd_top,100%x,30dip)
        napis_time_down(stran).Color = Colors.Transparent
        napis_time_down(stran).TextAlignment = napis_time_down(stran).ALIGNMENT_CENTER
        napis_time_down(stran).TextColor = Colors.ARGB(230,barvar,barvag,barvab)
        napis_time_down(stran).Font = Font.CreateNew2 ("Sansation",font_s * 0.5)
        napis_time_down(stran).Text = ""
        napis_time_down(stran).Visible = False

Can you upload the complete project?[/QUOTE]
Code i can post, but project is to large.
 
Upvote 0

stari

Active Member
Licensed User
Longtime User
Xou connect ELF or simple headphones and press start.
As i say, in debug mode is working OK, but in release App, this is on App Store, the labels are not updated ( module therapy - timer1_tick).
 
Upvote 0

stari

Active Member
Licensed User
Longtime User
Is there any simple code change that I can do to automatically start the relevant timer?
OK, you change Sub SetState to :

B4X:
Private Sub SetState
    Dim SignedIn As Boolean = auth.CurrentUser.IsInitialized
    Log("Set State - signed " & SignedIn)

    SignedIn = True
    signed = True
    pan(10).Text = ""
    Return

    If SignedIn Then
        signed = True
        fb_icon.Visible = False
        gm_icon.Visible = False
        pan(10).Text = ""
        Log("Hello: " & auth.CurrentUser.DisplayName)
        Log(auth.CurrentUser.DisplayName)
        Log(auth.CurrentUser.Email)
        Log(auth.CurrentUser.PhotoUrl)
        mess(pozdrav  & auth.CurrentUser.DisplayName)
    Else
        signed = False
        fb_icon.Visible = True
        gm_icon.Visible = True
        pan(10).Text = prijavi
        mess(prijavi)
        Log("Signed OUT from FB and Gmail")
    End If
End Sub


But you must connect headphones or ELF emmit.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I see this issue as well. You should now use iReleaseLogger to debug this issue: https://www.b4x.com/android/forum/t...-read-the-logs-in-release-mode.51164/#content

Waiting for debugger to connect...
Program started.
My IP Address 192.168.0.6
Waiting on port 54323
414 736 1
Delta :0.4375 Rate 0.2 Scale 1.0875
100%x = 414 100%Y = 736
Device Physical Size = 5.277799
Country = IL
Jezik = en
Configuring the default app.
Prebrana barva = 0
napis ELF TOP + height: 36 33 Napis ELF Bottom 69
Napis sredina TOP 139
Vpis na krog start
napis ELF TOP + height: 36 33 Napis ELF Bottom 69
Napis sredina TOP 139
Vpis na krog start
napis ELF TOP + height: 36 33 Napis ELF Bottom 69
Napis sredina TOP 139
Vpis na krog start
napis ELF TOP + height: 36 33 Napis ELF Bottom 69
Napis sredina TOP 139
Vpis na krog start
napis ELF TOP + height: 36 33 Napis ELF Bottom 69
Napis sredina TOP 139
Vpis na krog start
napis ELF TOP + height: 36 33 Napis ELF Bottom 69
Napis sredina TOP 139
Vpis na krog start
napis ELF TOP + height: 36 33 Napis ELF Bottom 69
Napis sredina TOP 139
Jezik = : en
b4j’s iPhone
iPhone
iOS
Set State - signed false
Action: 0 Pos X: 235 Pos y: 446.6667
Action: 2 Pos X: 230 Pos y: 444
Action: 2 Pos X: 224.6667 Pos y: 444
Action: 2 Pos X: 215.3333 Pos y: 443
Action: 2 Pos X: 203.6667 Pos y: 441.6667
page On = 1
Tag = : 1
//// Main funkcija = run
Hours : 0 Minutes : 35
402 10:23:30
Headset state: true
00:34:59
Terapija: Improve Sleep Trajanje : 1
403 10:24:30
Headset state: true
00:33:59
Terapija: Improve Sleep Trajanje : 2


I see that you have done it on purpose:
B4X:
Public Sub Initialize
#if debug
   tfactor = 1  
#End If
   timer1.Initialize ("timer1",1000 * tfactor)
So in release mode it is 60 *1000.
 
Upvote 0

stari

Active Member
Licensed User
Longtime User

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