#Region Project Attributes
#ApplicationLabel: b4aHeartBeatView
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim t As Timer
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.
Private hbv1 As HeartBeatView
Private Label1 As Label
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("main")
t.Initialize("t", 10000)
hbv1.DurationBasedOnBPM = 72
hbv1.ScaleFactor = 0.3
Dim hbv As Int
hbv = Rnd(30, 121)
hbv1.DurationBasedOnBPM = hbv
Label1.Text = hbv & " bpm"
End Sub
Sub Activity_Resume
hbv1.start
t.Enabled = True
End Sub
Sub Activity_Pause (UserClosed As Boolean)
hbv1.stop
t.Enabled = False
End Sub
Sub t_tick
Dim hbv As Int
hbv = Rnd(30, 121)
hbv1.DurationBasedOnBPM = hbv
Label1.Text = hbv & " bpm"
End Sub