How do I block an app from using mobile data even in foreground? I want to block an app from using mobile data even when that app is in foreground. How can I do that? I can find an option to disable mobile data when in background and an option to disable WiFi for an app but I want to disable mobile data for a specific app completely. I am using a Galaxy A71 phone with Android 10.
Use a Firewall. See Firewall Tag Wiki for helpful reading.
Net Guard is a well acclaimed app that does not need root access. It is an open source app developed by  Marcel and can be downloaded from F-Droid too. It is very effective and has excellent logging features too.