Android - Block apps from accessing the Internet on Android device

If you don't have root access on the device, then you can use mobiwol to control the access various apps have to the Internet. Mobiwol creates a 'virtual' VPN connection on the device which allows control of the individual app connections. However, although the app starts when the device starts it is possible that there may be a brief period prior to Mobiwol executing in which apps could get Internet access despite the Mobiwol configuration.

If you have root access, there are more alternatives:

  • Remove the 'internet' permission using an app like Permissions Denied
  • If your kernel supports IPTables, you can use an app such as AFWall+ to control which apps have access to the internet.

Without rooting your device, you won't have much choice: you can either disable the network when the app runs in foreground, as LinX64 suggested – or "hibernate" (suspend) it when it goes to background (is not actively used), as suggested by Dalvik. Of course, you could combine the two – which should effectively prevent that app from accessing the network. But still on the cost of bringing your entire network connection down as soon as you want to use that app.

With root-access, things look different: there are apps available dealing with other apps' permissions, allowing you to revoke some of them after you've installed that app. That way you could e.g. revoke the permission to access mobile data and/or WiFi just from that app: Your network connection would not be affected at all (so background-checks for mail and updates in WhatsApp/Viber/Skype/SE-App would keep working) – while the app-in-question would be told "there's no network available currently" (faking a "network down" just for that app).


Update:

Meanwhile there are Internet Firewalls available which also work on non-rooted devices. Simeon already mentioned Mobiwol – but a much better choice is NetGuard, available from F-Droid as well as from Playstore. Availability at F-Droid already indicates it's Open Source (almost a must in the security sector), and it comes for free. This is up to version 2.44 (added on 2016-08-06). Later versions from the Playstore have non-free dependencies, so the app is no longer updated in F-Droid's "official" repo anymore, and will likely not be. You still can obtain up-to-date versions via my F-Droid compatible repository, though.

NetGuard NetGuard
NetGuard (Source: Google Play; click images for larger variants)

As you can see in the first screenshot, if gives you very granular control:

  • Generally forbid an app access to WiFi or mobile data
  • Permit an app access to WiFi or mobile data only when screen is on
  • Regardless of above settings, keep it from accessing mobile data when roaming

It's by far the best rated app in this section – and though I haven't tried it myself, I'd say it's the one to recommend if your device is not rooted. Update: Note that recent versions of Netguard include Google Ads as well as Firebase Analytics – two things which IMHO have no business in a firewall (or any other security) application – which most likely is the reason it is no longer updated on F-Droid's official repo (still available in mine with the appropriate warnings).

With root access available, the candidate most likely is AFWall+:

AFWall+ AFWall+
AFWall+ (source: Google Play; click images for larger variants)

Like NetGuard, this app is open source (available at F-Droid and at Google Play), and allows to control internet access by WiFi and mobile data separately. But while it is more powerful in some ways, it seems to lack NetGuard's features of "screen-on" and roaming control (or I didn't see that).


Try the app No-Root Firewall. It allows you to control what apps have Internet access over both wifi and cell data. It works by setting up a VPN on your phone.

Tags:

Internet