i developing a game on Android, and it's requirement is :
- normal state app will show waiting screen
- when have person view device game will start
- when person leave game auto close and return to waiting screen
After researching i found method: using vision API services detect face to start game when user view & stop when user leave device. i able to do it, but problem is this solution made game very slow i think because face detect always running .
my question is have any other solution with best performance to detect person view/playing on device and don't effect to main program.
Thanks you.
If it is necessary for you to detect a face then I'm afraid you can only do the vision api, otherwise if you only need to detect if there is someone in front of the phone, then look into using the proximity sensor on android. Not sure if it is the most effective way, but it would be the best candidate solution I could think of.
Here's a reference on the usage of the proximity sensor