I need to build a android app that checks how much time you spend on a selected app X, if the consumed time is more than a preset value - the app will show a message every time you run X and X will exit.
As an example, you set in our app that the maximum allowed time for WhatsApp is 20 minutes per day. If you consumed the 20 minutes and you try to open WhatsApp - you will get a message and WhatsApp task will be closed.
Is it possible? If yes then how?
Please let me know with some sample code.