-2

I want to create an application in Android that will show the devices list of applications and then allow the user to select which apps they want to be restricted access to for a certain period of time.

I am aware there is an Android Application named "AppBlock" but i don't know how this works.

You select the app, the period of time and then it doesn't allow you to open the app.

2 Answers2

1

You cannot actually block start of another application. The only way that I see it is possible: you need to save the list of applications Info in your app that need to be blocked with the time when it need to be blocked. Implement a service that runs "forever" and detects started applications. Refer to this answer about how to do it. On each detection you should check if application present in your database and if the time now says it need to be blocked. If it is - close the application. Refer to this answer for learning how to do it. That is global architecture I think you should follow.

Community
  • 1
  • 1
Evgeniy Mishustin
  • 3,343
  • 3
  • 42
  • 81
0

To Build App Block u need the following things 1-Accessibity services (AS)2-Forground Services (FS) BY AS you will be able to stop activity that you have in your bloker list FS will alive your application context that help to find block app