Does Admob only need this code or does it need some created class?
NO. You need to make a request to retrieve the ad, which is only possible through a class. Here's an example:
// fazendo uma requisição
AdRequest adRequest = new AdRequest.Builder().build();
// adicionando a requisição no AdView.
adView.loadAd(adRequest);
See more AdRequest documentation .