Android is a very functional and extendable operating system, and at the end of the day, it remains a Linux distribution. Currently, it powers an estimated number of 3.9 billion phones around the world, or 70% of the smartphone market share.

One annoying aspect you may find in it, however, is that many Android apps and Android games are loaded with annoying or intrusive ads. Ads that usually don’t respect your privacy and try to spy on your activities across your entire smartphone usage.

Luckily, you can easily disable ads in all Android apps and games with this open-source application.

Blocking Ads in Android Apps and Games

AdAway is an open-source application available on the F-Droid store to block ads via the hosts file. F-Droid is a famously known open-source market application that only hosts open-source applications in its app catalog. If you don’t have F-Droid already, then you can download it as an .apk file from its official website and install it.

The “hosts file” is a system-level file in Linux-based distributions that allows or blocks access to any domain name via DNS. By editing this file, one will be overwriting the default DNS rules to control access to any domain name they want.

The way AdAway works is that its developers have already compiled a list of domain names that serve ads and other tracking scripts, so when you use the app, your system hosts file will be loaded with their lists so that these domain names get blocked. A dummy VPN connection is used to provide this functionality, although there is no real VPN connection used whatsoever.

Once these domain names are blocked, ads will no longer be shown across all Android apps and games on your system because they can no longer establish a connection to their original websites to serve ads.

It’s a very simple and effective idea.

Once you have F-Droid installed, you can install AdAway from the following link or search for it from inside the app on your smartphone.

The first window that appears when you launch the app will ask you about what approach you want to use to block ads. AdAway also supports using another method to block ads, but it will require a rooted device to work. Since most people don’t have rooted phones and don’t want to root their phones in order to avoid losing the smartphone vendor guarantee, we will just proceed with simple “VPN-based blocking”.

Once the app finishes syncing its block lists, it will start working automatically across your Android system.

block ads on android in apps and games 11

Just make sure you go to the preferences of the app, and turn on the following option to make sure that the application remains working even if you get disconnected from the network and reconnect later on:

block ads on android in apps and games 13

AdAway is a DNS-based adblocker. You can add, remove or redirect any domain name you want from the main window of the app:

block ads on android in apps and games 15

That’s all there is to do.

If you check some of your Android apps and games that used to contain ads, you will now see that they no longer show ads.


Purely using open-source applications, we have been successfully able to block intrusive and privacy-hijacking ads across our entire Android system. If there are certain websites or domain names that you want to whitelist, then you can easily do so from the application as well. You are in full control over your phone and what you want it to do.

Remember, though, that AdAway only blocks advertisements and not tracking scripts. For blocking tracking scripts with AdAway, you need to load it with additional compiled lists from the community.

AdAway can also be used to block pornography and mature websites by the way; you just have to load it with the needed block lists to do that. It could be a suitable way to help you secure your children’s smartphones, for example.

Notify of

Inline Feedbacks
View all comments


Enter your email address to subscribe to our newsletter. We only send you an email when we have a couple of new posts or some important updates to share.

Recent Comments

Open Source Directory

Join the Force!

For the price of one cup of coffee per month:

  • Support the FOSS Post to produce more content.
  • Get a special account on our website.
  • Remove all the ads you are seeing (including this one!).
  • Get an OPML file containing +70 RSS feeds for various FOSS-related websites and blogs, so that you can import it into your favorite RSS reader and stay updated about the FOSS world!