Initialize Google Mobile Ads SDK (Admob) only once?

if we need to initialize the Admob SDK, then do we need to initialize it once in MainActivity.class or do we need to initialize it in every action in which Admob ads are present?

According to this link: https://firebase.google.com/docs/admob/android/quick-start "To initialize the Google Mobile Ads SDK when the application starts, call MobileAds.initialize () in onCreate () of the MainActivity class."

So, should we only call it once for each ad in different actions?

+5
source share
2 answers

Your application only needs to call this method once, usually when it starts in the first step. There is no need to call it twice during one application launch or in each separate action.

See official white papers for more details.

+5
source

The best place to initialize your SDK ads is the onCreate method of your application. If you do not already have an Application class, I recommend creating one.

+4
source

Source: https://habr.com/ru/post/1260364/


All Articles