Sunday, April 29, 2012

Got Ads?

I know money makes the world go round, and I also know that there's a bunch of developers making great apps that make our life easier and it's just fair that they're paid for their work.

But I can't stand ads.  Banners on my screens are like flies in my soup or cockroaches in my bed.

Since I got my 1st Android, my tool to remove such annoyances was AdFree.

The concept is simple: To display ads, applications contact a web server on the internet and ask for a banner.  Said server logs the information it receives and provides the banner, more or less tuned for your demographics.

To contact that server, it needs it's address.  DNS is the directory service that provides computer's addresses to requesting programs.  But before asking a DNS servers, a local "hosts" file that contains name-to-addresses mappings is consulted.  If, instead of containing valid mappings it contains "broken" ones, it'll prevent the communication from happening.

There's a few online services that provides lists of ad servers for which broken entries can be created.

To leverage those lists, my pick is now AdAway.  My previous app failed after an upgrade, at which point I found this one.  It downloads a few lists, merge them, and updates your hosts file.  Note that your device must be rooted for this to work.  Otherwise you don't have the privileges necessary to update system files.

Some of the good features of AdAway include customizing the list of URLs from which to fetch hosts lists, adding whitelisted items and using an included local webserver to serve fake ads and prevent some applications from crashing or displaying lenghty error messages because they can't reach their ad server.