Sorry to come back on such an old topic but when I execute this code on Redmi11 I get a fixed value of 98.508 and despite my moves.
(and TYPE_STEP_DETECTOR appears with value 1 when I start moving)
What is wrong here please ?
Only Targetsdkversion=28 displays those 2 values. Higher version says "not supported". So another question is how to count steps with version 33 ?