I would like to prevents all app except one (which I use it in foreground) to use WiFi network.

The phone is not rooted so the root firewall are not suitable, and also I don't want to use firewall which create VPN connection.

I have tried how-to-restrict-background-data-for-metered-wi-fi-networks-on-android but when I check the network traffic of the device it contains closed app traffic also.

  • The link you referred to is for restricting WiFi networks (i.e. which WiFi APs to deal with as if they were "mobile data"), not to exclude apps from WiFi usage. The latter IMHO is only possible using a firewall. If you don't want that, I'm afraid there's no chance.
    – Izzy
    Aug 31 '17 at 8:49
  • @lzzy What this option actually do? It say it prevents app from running in background Aug 31 '17 at 10:22
  • 1
    As I wrote: It marks the AP to be dealt with like "mobile data". That is, if you restrict background data for an app, which only applies to mobile data, it will be applied to that WiFi network as well. But, as with mobile data, only for what Android counts as "background data". For more details, see e.g. How does “Restrict background data” work?
    – Izzy
    Aug 31 '17 at 10:31
  • Thanks for your clarification, So if I activate Background Data on mobile data it will be apply on selected WiFi in restrict network, and OS will prevent selected apps (in Background data list) from running in background, and work like firewall for background traffic Aug 31 '17 at 15:54
  • But only for background data. I'm not sure where the "border line" is when an app comes into foreground ;)
    – Izzy
    Aug 31 '17 at 16:57

In the place described on the linked page¹ you can mark selected APs to be dealt with as if they were "mobile networks" – i.e. "background data restrictions" which usually apply to mobile networks only would be applied to those as well.

In order for that to have any effect, you either need to toggle the "background data" setting – or limit background data for those apps which should not use them. The latter can be done in Settings › Data Usage below "mobile data limit", where you first need to set a global limit (can be some "phantom value", i.e. very high). Then walk the apps below that and tick their "limit background data" setting.

I'm not 100% sure what falls into background data – but roughly it should be what an app does without your explicitly telling so. A.o. that's "background syncing" and similar "intervall stuff" – but definitely nothing you'd have to setup manually, like loading a page in your browser.

¹ Nougat (Android 7) and up: Settings › Data Usage › Network Restrictions
  below that: Settings › Data Usage, tap "More" (or the 3-dot overflow-menu) › Restrict Networks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.