i know i am having a bad day, but does this help??
Sub Activity_Create(FirstTime As Boolean)
'StopService(Starter)
Activity.LoadLayout("1")
'Activity.Title = "Search for Ble devices " & gcVersion
Activity.Title = gcVersion
'Msgbox("we are here","")
Log("started")
sbLowHr.Initialize
sbHighHr.Initialize
smb1.Initialize("smb1")
gcManufacturer = phone1.Manufacturer
gcModel = phone1.Model
gcProduct = phone1.Product
gcSerialNumber = phone1.GetSettings("android_id")
'''''''''''
If FirstTime Then
GetScale
End If
If File.Exists(File.DirAssets,gcDbfFileName.ToLowerCase) = True Then
If File.Exists(File.DirInternal,gcDbfFileName.ToLowerCase) = False Then
File.copy(File.DirAssets,gcDbfFileName.ToLowerCase, _
File.DirInternal,gcDbfFileName)
' Dim cText As String = "Busy installing " & gcDbfFileName
'
' ct1.ShowBitmap(cText,5000,Gravity.CENTER_HORIZONTAL,0,0, _
' LoadBitmap(File.DirAssets, "smiley.gif"))
End If
Else
pw.KeepAlive(True) 'Display on, bright
Msgbox2("does NOT exist!" & CRLF & "program will close.", gcDbfFileName, "Close", "", "", LoadBitmap(File.DirAssets, "smiley.gif"))
pw.ReleaseKeepAlive
Activity.Finish
ExitApplication
End If
SQL1.Initialize(File.DirInternal, gcDbfFileName, True)
Check4Updates
BtAdmin.Initialize("MyBlueTooth")
If BtAdmin.IsEnabled = False Then
BtAdmin.Enable
'Else
' BlueTooth.Listen 'listen for incoming connections
End If
'StartScan
StartScanning
end sub
Sub StartScanning
'
https://www.b4x.com/android/forum/threads/ble-heart-rate-monitor.64102/#content
Dim HrMonitor As HeartRateMonitor
HrMonitor.Initialize
Dim CadMonitor As CadenceMonitor
CadMonitor.Initialize
End Sub