Or you could have them place the phone on their back and use the sensors to detect the up and down movement then audibly count the reps.
Android Development
Welcome to the programming.dev Android development community!
The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License
How many are you doing that you lose count?
The proximity sensor may be the way to go, but the range is pretty small. Still, less complicated than using the camera, and if someone is seeking this kind of app, I doubt they'd want to "cheat" by only pushing up 10cm, haha. Could place the phone under your chest instead of face too.
There used to be a lot of apps that did this after the year 2000. Maybe you could ask for microphone permission and add one push-up when the user says something loud (anything actually as long as it’s loud). It would add one push-up when you’re close to the microphone and say one, two, three, etc.
No need to recognize words or translate, just add one according to the level of the sound.
Did you check some articles on that? https://scholar.google.com/scholar?hl=en&as_sdt=0%2C5&q=push+up+smartphone+detection