I got from an Android 4.4.2, this:
and the b4a code line is
Perhaps we should use a "try-catch" block there?
B4X:
Caused by java.lang.RuntimeException: Object should first be initialized (JavaObject).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4j.object.JavaObject.getCurrentClass(JavaObject.java:258)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:118)
B4X:
Return sensor.RunMethod("isHardwareDetected", Null)