How to access file from SDK in android?

android hotspot filtering and blocking

  • I want to be able to treat my android wifi hotspot like a router and moderate the content that I can access through it. Is there something like a hosts file I can use? I want to block distracting websites. I go through periods of obsessively reading the internet (including metafilter) and this seriously hampers my productivity. (seriously, brain, what is with the addiction to interesting but not directly useful information??) Usually this is during holiday periods, but also when I get stressed. (It's numbing and then I don't have to deal with the discomfort of the present.) I have dealt with this in the past by using the hosts file on my computer to route my browser to 127.0.0.1 instead of the problematic site, which stops the auto-pilot habitual browsing, and helps me (re)develop the self-discipline to use my time appropriately. However I have moved house since my last major bout with this issue and now consume my internet through an android phone data connection (3/4G)- either on the phone's browser or by using the "portable wifi hotspot", instead of through a router and wifi connection. I know I can put the hosts file back in place on my computer, but I also now consume internet through multiple devices and would like to block the distracting sites at the node: my phone. So: how can I do that? I've got an Android ZTE T81 with the vanilla OS - 4.0.4. Happy to consider purchasing an app/solution that works. (preferably 5$ or less.) (I've also just installed Tasker, which probably isn't directly useful to this problem, but I have no idea if it might be.) Bonus points for self-discipline tips, that will let me benefit from good websites without getting sucked down rabbit holes, but I am really looking for a technical solution to fix/stop this now. I know I can just unblock the site again, but blocking websites has helped in the past and I'm looking for how to implement this in my new situation. If I can't filter my 3G connection, how would I go about blocking sites on android devices, preferably without installing a new browser?

  • Answer:

    I'm using Android 2.3.5, so things might be different for you, but adding websites to the android HOSTS file doesn't block those sites *on my computer* when using the phone's 3G connection. Adding the sites to the HOSTS file on the computer does. Adding them to the HOSTS file on the phone blocks them on the phone. If you're open to an alternative, you might look into setting up some custom DNS servers that allow you to use parental controls, http://www.opendns.com/parental-controls. It sounds like you can add custom sites to the list to block them. Then, set up your computer to only visit those DNS servers and no matter which connection you use, you'll have those sites blocked..

titanium_geek at Ask.Metafilter.Com Visit the source

Was this solution helpful to you?

Other answers

Ah... sorry for the threadsit- of course HOSTS file on the phone won't block that on the computer- to clarify, I'm looking for a similar sort of "this is a list of sites not to go to" list on my phone, which will in turn stop access on devices going through the phone. Thanks for showing me it is possible to edit the hosts file on an android though.

titanium_geek

Yeah, I use the aptly-named "hosts editor" to edit the HOSTS file on my phone. I think the problem is that your phone is unlikely to be advanced enough to engage in the level of blocking that you want it to. Your network operator might be able to block specific websites - mine blocks gambling/adult websites by default - but they have much more control over your internet access than your phone does because they have the hardware setup to do it. Does the blocking have to occur at your phone, or could it occur somewhere else while still using the phone's connection? I think I've managed to get what you want to work, albeit in a different fashion, by doing the following: 1] Set up an account at OpenDNS. 2] Link the phone's IP address with OpenDNS, via the Dashboard, then set up a custom block for a specific site (www.google.co.uk in my case). 3] Start the 3G connection on the phone, then use Set DNS to set the DNS servers that the phone will use to the OpenDNS server addresses. The DNS servers recognise your phone's IP address and apply the custom block list to it. I've tested that I can visit images.google.co.uk on the phone and the computer when using the phone's 3G connection, but I can't visit www.google.co.uk on either the phone or the computer (which is using a different set of DNS servers) when using the phone's 3G connection. It seems that the phone itself is blocked by the OpenDNS servers from resolving the address.

Solomon

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.