It is a wrap for this Github project
You need to enable AppCompat V3.20 in the libs tab of the B4A project.
Attached the B4A sample project, the B4A library files, and the Java code. You will need a recent version of android-support-v4.jar in your additional library folder as well as AppCompat V3.20 by @corwin42
You can drive this PULSING heart from data collected from a Bluetooth connected Heart Rate Monitor.
Seems that you need at least Lollipop to run this project.
Sample code:
You need to enable AppCompat V3.20 in the libs tab of the B4A project.
Attached the B4A sample project, the B4A library files, and the Java code. You will need a recent version of android-support-v4.jar in your additional library folder as well as AppCompat V3.20 by @corwin42
You can drive this PULSING heart from data collected from a Bluetooth connected Heart Rate Monitor.
Seems that you need at least Lollipop to run this project.
Sample code:
B4X:
#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