Android Question Debug Work / Release dont work

MarcoRome

Expert
Licensed User
Longtime User
Hi all.
Happens one thing strange.
Same code in real device in "Release" dont work in "Debug" work ??

This is code:
B4X:
Sub BTN_Click
   
    Dim b As Button
    b = Sender
    Command=b.Tag

    Select Case Command
        Case "up" ' Volume Up
            sCMD = "KEY_VOLUP"
        Case "down" ' Volume Down
            sCMD = "KEY_VOLDOWN"
        Case "mute" ' Mute Toggle
            sCMD = "KEY_MUTE"
        Case "off" ' Power Off
            sCMD = "KEY_POWEROFF"
        Case "changep" 'Change Channel +
            sCMD = "KEY_CHUP"
        Case "changem" 'Change Channel -
            sCMD = "KEY_CHDOWN"
    End Select

   
    Try
        remote.Initialize("Remote Control",devicemac,ip_tv,"55000")
        remote.Connect
        remote.sendCode(sCMD)
        Msgbox("Sono qui","Msg") ' <----------- In Debug Mode work without problem
    Catch
        Log("Something went wrong! What? No idea.")
        Msgbox("Non va","Msg") ' <--------- In Release Mode dont work 
        remote.uninitialize
    End Try
End Sub

Any idea ??

Thank's
 
Last edited:

MarcoRome

Expert
Licensed User
Longtime User
Thank you Erel.

if i call same code in another module and in second time work also in Release mode:

Main:

B4X:
Sub Process_Globals
   
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module. 
    Dim Button1 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("test")
End Sub

Sub Button1_Click
     StartActivity(remote)
End Sub

and in module "remote" i put same code:

B4X:
Sub BTN_Click
 
    Dim b As Button
    b = Sender
    Command=b.Tag

    Select Case Command
        Case "up" ' Volume Up
            sCMD = "KEY_VOLUP"
        Case "down" ' Volume Down
            sCMD = "KEY_VOLDOWN"
        Case "mute" ' Mute Toggle
            sCMD = "KEY_MUTE"
        Case "off" ' Power Off
            sCMD = "KEY_POWEROFF"
        Case "changep" 'Change Channel +
            sCMD = "KEY_CHUP"
        Case "changem" 'Change Channel -
            sCMD = "KEY_CHDOWN"
    End Select

 
    Try
        remote.Initialize("Remote Control",devicemac,ip_tv,"55000")
        remote.Connect
        remote.sendCode(sCMD)
        Msgbox("Sono qui","Msg") ' <----------- In Debug Mode work without problem
    Catch
        Log("Something went wrong! What? No idea.")
        Msgbox("Non va","Msg") ' <--------- In Release Mode dont work
        remote.uninitialize
    End Try
End Sub
 
Upvote 0
Top