1

i am developing simple step counter app app works on almost devices but problem is app not working on some Samsung phones and other phone which don't have step counter sensor. I don't want to use Google FIT I Have Activity Recognition permission accepted still step counter not working

<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />

Phone model :Galaxy A7 2018 | SM-A750GZBJTPA

its not working because this model don't have STEP_COUNTER AND STEP_DETECTOR sensor.

other apps from markets are working, i don't know how they implemented that functionality

i am trying to implement through accelerometer sensor but application stop counting sensors when phone is in DOZE MODE, anyone suggest how to implement?

  • 1
    I also got this error recently. – Thanh Tung Jun 03 '21 at 04:09
  • @ThanhTung i used accelerator to count steps in background. It is condition based if phone have step counter sensor then use it else use accelerameter sensor. even app is closed, It's is very bad practice to hold wake lock, but i have no choice so i hold wake lock and detected high peak to measure step all time. disadvantage is huge battery consumption. – kamlesh parmar Jun 03 '21 at 04:57

0 Answers0