• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Urls Blocking with your Android App

Veclar

Newbie
Hello Guys,
i am creating an application. in which i want to block adult content and other URLs of user choice. i need to know the best way to do this task. is it possible to do so? need your help!! Thanks!
 
Do you want to block certain URLs being accessed in a browser app (e.g. Chrome)? I don't think there's a way you can do that from another separate app.
You could write an app with an embedded Webview, that way you could have more control over what it's allowed to access.
 
Do you want to block certain URLs being accessed in a browser app (e.g. Chrome)? I don't think there's a way you can do that from another separate app.
You could write an app with an embedded Webview, that way you could have more control over what it's allowed to access.

yes i want to block URLs for chrome. it can be possible with creating Webview in you app but i don't want that. i just want to access the permission in my app so i can set rules on chrome.
 
Do you want to block certain URLs being accessed in a browser app (e.g. Chrome)? I don't think there's a way you can do that from another separate app.
You could write an app with an embedded Webview, that way you could have more control over what it's allowed to access.

waiting for your response!
 
I already said I don't think there's a way to do this programmatically. Apps in Android have strictly partitioned data areas, and can't normally access each other's data. What you are trying to do may be possible if you were running your app on a rooted device.
 
I already said I don't think there's a way to do this programmatically. Apps in Android have strictly partitioned data areas, and can't normally access each other's data. What you are trying to do may be possible if you were running your app on a rooted device.

i have seen some apps on YouTube that are doing the same thing that i want to do. without rooting the device.
 
yes i want to block URLs for chrome. it can be possible with creating Webview in you app but i don't want that. i just want to access the permission in my app so i can set rules on chrome.

You'd need add the URLs you want blocked into the hosts file, which on Android is in /system/etc/hosts and you need root to do that. Even on Windows you need to be admin to modify and edit the hosts file.
 
You'd need add the URLs you want blocked into the hosts file, which on Android is in /system/etc/hosts and you need root to do that. Even on Windows you need to be admin to modify and edit the hosts file.

is there any other way instead of rooting phone and changing hosts file? because there are some Apps that are doing URL blocking. and i don't think they are rooting the users devices. and i don't think it is possible to root users device programmatically
 
is there any other way instead of rooting phone and changing hosts file? because there are some Apps that are doing URL blocking. and i don't think they are rooting the users devices. and i don't think it is possible to root users device programmatically

What apps are they? Firewall type ones? Maybe they use a remote proxy and are basically a VPN? Which is really what things like NetNanny does, and blocks sites that are unsuitable for minors.
https://play.google.com/store/apps/details?id=com.contentwatch.ghoti.cp.browser&hl=en

If necessary post the Play Store URLs. To do anything with the hosts file on Android, root is required.
 
Last edited:
What apps are they? Firewall type ones? Maybe they use a remote proxy and are basically a VPN? Which is really what things like NetNanny does, and blocks sites that are unsuitable for minors.
https://play.google.com/store/apps/details?id=com.contentwatch.ghoti.cp.browser&hl=en

If necessary post the Play Store URLs. To do anything with the hosts file on Android, root is required.

yes i am trying to do the same as net nanny app is doing. so can tell me what methodology they are using.
 
yes i am trying to do the same as net nanny app is doing. so can tell me what methodology they are using.

I believe it points the phone's DNS request settings at the Net Nanny server, and so all browser requests go though that. And that does all the filtering of undesirable URLs.

Many carriers in the UK operate proxies that block adult and gambling sites by default, unless you can prove to them you're over 18. Of course here in China most of us know all about internet filtering, and that's why I use a VPN to unblock the interwebs.
 
Last edited:
I believe it points the phone's DNS request settings at the Net Nanny server, and so all browser requests go though that. And that does all the filtering of undesirable URLs.

Many carriers in the UK operate proxies that block adult and gambling sites by default, unless you can prove to them you're over 18. Of course here in China most of us know all about internet filtering, and that's why I use a VPN to unblock the interwebs.

well do you know how to points phone's DNS request to own server. and what kind of server this should be?
 
Back
Top Bottom