B4J Question Polar H10 heart rate reader

flyway

New Member
Hello,
Am new here and need help building up an application (preferably in B4J) to read HR measures from a Polar H10 chest band (BLE comms).
Have tried alot of samples and snipets, using other languages, and got sucess at 90% so far...
A friend told me about B4X option, and am giving it a try for a couple days, so am very fresh at this coding language... :D
Although have some experience in VB (v6 and .NET) and little bit of C#/C++.
Anyways, have already implemented a little prog around the class HeartRate Monitor.BAS, but am facing a bit of difficulties here...
Can anyone help me?
Here error log;

B4X:
Waiting for debugger to connect...
Program started.
Error occurred on line: 7 (HeartRateMonitor)
java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at b4j.example.heartratemonitor.innerInitialize(heartratemonitor.java:21)
    at b4j.example.heartratemonitor._initialize(heartratemonitor.java:42)
    at b4j.example.main._appstart(main.java:94)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at b4j.example.main.start(main.java:38)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NoClassDefFoundError: android/bluetooth/BluetoothGattCallback
    at b4j.example.heartratemonitor._class_globals(heartratemonitor.java:80)
    ... 31 more
Caused by: java.lang.ClassNotFoundException: android.bluetooth.BluetoothGattCallback
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 32 more

Sorry, think this should be posted in B4J forums...
Can some Moderator move it to correct place?
Thanks.
 

flyway

New Member
Yes Erel, I posted in the wrong forum. Sorry.
Can you move it to the B4J forums?

About B4J dealing/ reading BLE devices... Any ideas of making it working?
I need a any simple windows app that can sendo to a file or comm port Heart Rate values..
Can anyone help here?
 
Upvote 0
Top