Is it necessary to initialize the ad in adMob?

1

I have two apps in the play store and in a non-use

MobileAds.initialize(this, APP_ID);

And in another if, could you explain the difference between doing it or not? Both upload the advertising perfectly and I do not have any kind of warning from adMob

The admob documentation says we have to do it, but I do not do it and it works.

    
asked by Orz 31.10.2017 в 14:48
source

1 answer

0

Actually with the previous method the initialization of the Announcement was also carried out, this by means of the ad_unit_id that defined a format and type of announcement, by means of which we configured our AdView :

  <com.google.android.gms.ads.AdView      
        android:id="@+id/adView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        ads:adSize="LARGE_BANNER"
        ads:adUnitId="@string/banner_ad_unit_id" >
    </com.google.android.gms.ads.AdView>

Now the current implementation requires AdMob with Firebase and this implementation requires what you comment, the Initialization in this way:

public class MainActivity extends AppCompatActivity {
    ...
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713
        MobileAds.initialize(this, "YOUR_ADMOB_APP_ID");
    }
    ...
}

Both methods require initialization , previously the Ad unit id was used and now the is used AdMob app ID which is a unique ID assigned to your apps when they are added to AdMob. .

  

app ID : is a unique ID number assigned to your apps when they are added to AdMob. The ID of the application is used to identify your   applications.

     

ad unit ID : is a unique ID number assigned to each of your ad units when they are created in AdMob. The block ID of   Ads is added to the code of your application and used to   identify ad requests from the ad unit.

    
answered by 31.10.2017 / 18:04
source