AdAway is an ad blocker for Android applications. What this open source app does is change the host file to prevent contact between applications and ad servers.
In order for the application to work, you must give it root permissions. When AdAway is installed, you must click on "Download files and apply ad blocking". There, the app will automatically download and apply all host filters, make changes to the system and ask you for access to Android's root permissions.
Accept what the system changes and when the process is finished, restart your mobile so that the changes are applied correctly and AdAway starts working, blocking annoying ads.