Is there a way to block ads on the nexus?

OP
B

blacksoxing

Active Member
Joined
Oct 1, 2010
Messages
256
Reaction score
26
I just ran into that. Thank goodness

Though some apps still have ads in 'em. Crap
 

captdroid

Senior Member
Joined
Jun 30, 2010
Messages
1,797
Reaction score
17
Bah... live with a couple ads if you must. Pays the devs and who knows you might see an add that interests you... I usually don't see them anymore though... my mind just tunes them out unless I am actually looking at them :D
 

HarvesterX™

Member
Joined
May 13, 2010
Messages
557
Reaction score
9
Location
Virginia, USA
AdFree is really good. It just does what all ad blocking apps do though. It keeps your hosts file (/etc/hosts) updated with a large list of known ad urls. With AdFree you can also register on the website (link is in the app) and customize which lists of urls are added to the hosts file. You can also use AdFree to load up a tcp dump. This is useful if ads are still getting through and you need help finding the URL that you need to block.

You can always just download a hosts file and manually put it in the /etc directory but AdFree does add the extra functionality described above as well as being able to have it auto check for updates. There might be time as well that AdFree (well your hosts file) is blocking a url that you DO want to see. For example, I play The World of Magic a lot and there are free offers that you can do for free platinum. I have to temporarily revert my hosts file back to normal (or remove the urls but that's too much if a hassle) so that I can load the the pages in the browser. This is really simple to do wth AdFree with the click of a button.

The default list does a good job at blocking most stuff from your phone, but keep in mind that the more custom lists that you add to your hosts file and block, the higher the chances are that something might not work because access to a network is being blocked. I doubt this will happen that often though, if at all, but it's nice to know ahead of time of what might go wrong so you know how to fix it.

There was another really good ad blocking app in the market that I used to use, but that one stopped working a few months ago and I never tried installing it lately to see if it's been fixed yet. For some reason it wasn't able to update the hosts file and it was acting like I wasn't rooted. I'll try it out out again and see if it works and if it does I'll drop the name of it back to ya.

That's my experience with AdFree. :) I'm happy enough just manually downloading a hosts file (simple google search will yield you a tons to chose from) but I keep the app around for the tcp dump feature and ability to revert back to normal with a click and then turn ad blocking on again with another click. The GUI is still as ugly as it's always been though lol, but don't let that deter you. Good app with good support. It's an XDA member's creation and last I checked the dev is still active even though this app has been around for ages (used it on my og droid lol)

Edit: Ok, I checked out the other app I used to use and it's working fine now. AdAway is the name. I prefer the interface a lot more to AdFree and it has a whitelist as well which comes in handy when you want certain urls to come through. It also has a server that you can enable and have run in the background that logs urls trying to be accessed, so it's really helpful if you see an app and it still has ads. You can turn the server on, run the app that still has ads and find the URL, then go back and add the URL to the blacklist. Also has some additional debugging options as well, as well as being able to set it to check for updates on a schedule so your hosts file remains up to date. I can't justify having that run in the background myself, even if the overhead is tiny, when it only takes a minute to manually check for updates whenever you feel the need, but that's my preference. Having it check by itself on a schedule isn't going to impact battery life or performance to any percievable margin though. I'm just OCD.

Both apps have good support and do the job. I'd try em both out and see which one you prefer yourself. At the core level of replacing your hosts file and blocking ads, but get 5 stars. AdAway exposes other levels of customization though from within th app that you'd have to open a web browser and log in the modify on AdFree. For this reason alone, I'd give AdAway 4 stars for what it exposes within the app where as I'd give AdFree 3 stars. That's a 4.5 star rating total for AdAway and a 4 star rating for AdFree.

Edit2: Quick correction. When I said AdAway has a server you can run in the background to log DNS requests, I meant to say you can use tcp dump to log DNS requests. Both apps have this (although I never could get it to work in AdFree, ymmv). When I was referring to the Web server in AdAway you can run, that's a different feature altogether. Instead of just redirecting blocked DNS requests back to the local hosting, you can run the server and have requests redirected to a different IP address. I think AdFree also has this but I couldn't ever get it working. I've never used this anyways and I seriously doubt many people have unless they had very specific reasons to do so. The hosts file is there so that you can map DNS names with IP addresses manually. If there a DNS name paired with an IP address in this file for a URL being requested, it uses the IP address listed instead of having to do a DNS name check on the IP address. This is also how we can block ads. We add the URL of the ad provider to hosts file and instead of mapping it to the correct IP address, we are instead mapping it to the IP address that is associated with our local device, hence the actual IP address gets blocked.

Example, and app you are running is trying to pull an ad from www.adssuckbutweservethemanyways.com. Normally a DNS name call is made at this point so we can get the IP address and complete the ad request. Instead, this url name is in our hosts file and mapped to localhost. Nothing is returned to the app and the ad is blocked.

And upon further checking i just noticed a lot of the custom lists in AdFree (that you can enable from the webpage) are pointing to invalid sources. A hosts list will be a URL that returns a plaintext hosts file. Like I said, you can get tons of these with a simple "hosts file" google search. It's not an android specific thing. Hosts file work the same whether on Windows or Android. This also means you can block ads the same way in Windows but that's off topic.

I'd suggest AdAway at this point because there seems to be a few fundamentally flawed things going on atm with AdFree (even though some of the lists are working as well as the default one). I would use the default lists that AdAway has listed (menu > hosts) and if desired, I can post them full list of ones that I personally have on there here and you can add those in.

One more thing. When adding blacklist and whitelist URLs, you can use wildcard characters. So in our above example an app is requesting an ad from www.adssuckbutwestillservethem.com/badsexads/10811 (I added more to it to show how this works). You could just add that entire URL and block that particular ad but if an ad from that domain is making it's way to your phone other ads might as well so it would he better to just block that entire domain. You could do this by adding *.adssuckbutwestillservethem.*. Or maybe you want ads showed from that domain except sex ads. Looking at the original URL, adding this might do the trick... www.adssuckbutwestillservethem.com/badsexads/*.
 
Top