I'm currently working on a project that is going to have over 100 android devices used and the users of each device will also change on a daily bases.
What we want to achieve is that the user is allowed to open only 1 or 2 of the apps on the device. Meanwhile, everything else should be forbidden.
I've seen that G suite offers app whitelisting, but that doesn't really seem like the right use case and also it would cost more than 500$ a month to maintain. Also, the apps that will be on those devices will not be published on play store and will be directly installed via apk.
Thanks in advance!
Have you checked UserStatsManager class, you need to check which application is foreground and then you can display your own activity if it's not the intended one.