Sub Process_Globals
Dim MyTimer As Timer
End Sub
Sub Globals
Dim t1 As Long
Dim MyBeeper As Beeper 'Need audio library
End Sub
Sub Activity_Create(FirstTime As Boolean)
MyBeeper.Initialize(200, 500) '200 milliseconds, 500 hz
' MyBeeper.Initialize(Rnd(100,301), Rnd(400,601))
' MyBeeper.Initialize(Rnd(20,101), Rnd(100,201)) 'low
MyTimer.Initialize("MyTimer",2000)
t1=DateTime.Now
MyTimer.Enabled=True
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub MyTimer_Tick
Dim t2 As Long
t2=DateTime.Now
MyBeeper.Beep
If t2-t1 >=20000 Then 'wait 20 sec
MyTimer.enabled=False
MyBeeper.Release
Activity.Finish
End If
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then ' Checks if the KeyCode is BackKey
MyTimer.Enabled=False
MyBeeper.Release
Activity.Finish
End If
End Sub