I'm building a parental control app that blocks access to certain sites - aka a simple firewall for Android. What do you think the simplest method of doing this would be?
I've seen other applications use VpnService to monitor the traffic - but I'm looking for any and all suggestions, methods and ideas related to this subject.
Thus far I've built the UI for the application - it stores all the user data necessary for each user profile - now it's time to make it function and block some traffic (for example - when a kid logs onto a porn site after midnight!)
Any and all ideas / input is greatly appreciated!
(and of course - the simpler the implementation: the better!)
NoobNinja
I'm starting to do a bit of research into what it would take to develop a simple firewall that would monitor browser traffic via a combination of Broadcast Receivers and the ActivityManager class.
Fortunately, this is not possible, for obvious privacy and security reasons. You cannot unilaterally spy on other apps' traffic using "Broadcast Receivers and the ActivityManager class".
What the app in question uses is a VpnService
to pretend to be a VPN connection, and spy on other apps' traffic that way. This requires the user to actually set up the app as a VPN provider and use it for a VPN connection.
来源:https://stackoverflow.com/questions/15623110/how-could-one-create-a-firewall-app-in-android