title: How to Filter All Internet Access on Android
body: <p>I would like to make an app that allows you to block certain internet sites on Android. For instance, you set what sites to block in my app, then when you try to access that site through chrome (or another browser on Android) you are denied access.</p>
  
  <p>The <a href="https://play.google.com/store/apps/details?id=com.trendmicro.tmmspersonal&amp;hl=en" rel="nofollow noreferrer">trend micro app</a> can do this, as can some others, however I cannot work out how. Possible ideas I have are as follows (although I am not an android dev, not sure on feasibility):</p>
  
  <ul>
  <li>Set up VPN / proxy that runs in-app, routing all device traffic through this. Seems like a lot of work to tunnel all traffic via your app.</li>
  <li>Set up a DNS proxy, however that only will filter at domain level (rather than URL level) and has some other issues</li>
  <li>Edit hosts table. Requires root access.</li>
  </ul>
  
  <p>Is there any other way I missed? How do similar apps do this, and how would you go about it? It would be great if there was some way to hook in to network calls to accept / block / redirect traffic rather than having to tunnel all network data through my app. Thanks</p>