Android Question how to block usage time of a specific app to 1 hour?

Alessandro71

Well-Known Member
Licensed User
Longtime User
your question is quite vague: I can say that Google Family Link allows setting usage limits on apps, but it may not be what you're searching for.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
if you're talking about programmatically allowing your app (not somebody else's app) run for an hour, in theory you could set a timer for an hour, and when it runs down, call activity.finish.
but there are a number of problems.
you would need to run a foreground service in the event the activity is moved to background by the os. then you need to raise an event on the ui thread from the timer. then you have to make sure the app is actually running when the timer winds down. then, of course, there is the issue of a user's simply starting up the app again for another hour...

@Alessandro71 has pretty much covered your options.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…