Android Question Countdown Timer

I'm new to programing and to B4Android. I am trying to create an app that will let me insert the time into an EditText, display it on a Label and then start counting. How do I parse my result in EditText into Hours / Minutes using B4A? I would really appreciate any help!
i don't know how to manually set the time to EditText and display it to Label. can someone help me with my problem? this is my First time in B4A i want to learn.

Sub Process_Globals
    Private timer1 As Timer
    Private targetTime As Long
End Sub

Sub Globals

    Private EditText1 As EditText
    Private Go As Button
    Private Label1 As Label
    Private Pause As Button
    Private Reset As Button
    Private Set 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:
    If FirstTime Then
        timer1.Initialize("timer1", 1000)
    End If
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub StartTimer ( minutes As Int)
    targetTime = DateTime.Now + minutes * DateTime.TicksPerMinute
End Sub

Sub Timer1_Tick
    Dim t As Long = Max(0, targetTime - DateTime.Now)
    Dim   minutes, seconds As Int
    minutes = (t Mod DateTime.TicksPerHour) / DateTime.TicksPerMinute
    seconds = (t Mod DateTime.TicksPerMinute) / DateTime.TicksPerSecond
End Sub

Sub Set_Click
End Sub

Sub Reset_Click
End Sub

Sub Pause_Click
    timer1.Enabled = False
End Sub

Sub Go_Click
    timer1.Enabled = True
End Sub
Last edited:
Upvote 0
This is the Design of my app I've search possible solution for my problems in Google but i can't find any of it. );


  • Capture.PNG
    44.7 KB · Views: 521
Upvote 0