If you have a rooted phone (rooting will not be explained his guide. If you do not know what rooting a device means, you should not be trying it – the process can brick your device) blocking ads can be fairly easy. Connect to the internet and run the Google Play Store app.
Use the Play Store’s search feature to look for an app called ‘AdAway’, developed by Dominik Schürmann. The app is free, tap install to download it (the app is useless on an unrooted device).
Run the application from the app drawer. On the first run, the app will ask for root permission (this is automatically handled if you have SuperSU installed), choose ‘accept’ or ‘grant’ to proceed.
Once the app has root permission, it will require internet access to download host file updates (this will block known hosts, which apps use to display advertisements). Make sure you are connected to the internet and then tap the update button (two clock wise arrows) on the top right.
The app will check for updates and notify you if they are available. Now tap the ‘Download files and apply ad blocking’ button. The app will download the updated host files and apply them (with the root permission).
After the host files are applied, the app will prompt you to restart your device. You should choose to restart your device to ensure that the previous data is cleared.
After rebooting your Android, you can now try using an app which showed advertisements earlier - now it should not.
However, some apps will continue to push ads. To get rid of these, run AdAway again and press the menu key. Select the ‘Log DNS Requests’ option from the list.
On the next page, tap the ‘Tcpdump is not running!’ button. Now the button should read ‘Tcpdump is running’. Press the home key now, this will minimize the app (keep it running in the background).
Now you need to run the app which displayed advertisements and then close it to return to Adaway again.
The log file should now have the hostnames you need to block. Tap the ‘Open log file’ button to view the hostnames and then add them to the app’s black list by selecting ‘Your Lists’ from the menu.
Keep checking for updated host files regularly to continue blocking advertisements.